﻿// JScript File

function ConfirmAboutUs() 
{
	ALERT("");
}



function ConfirmDeleteOrder() 
{
	if (confirm("!این خرید حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*******************************************************************************************
function ConfirmDeleteNews() 
{
	if (confirm("!این خبر حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*******************************************************************************************
function ConfirmDeleteItem() 
{
	if (confirm("!مورد انتخابی شما از بانک حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*******************************************************************************************
function ConfirmDeleteInterView() 
{
	if (confirm("!متن مورد نظر شما از بانک حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//******************************************************************************************
function ConfirmDeleteResearch() 
{
	if (confirm("!مورد انتخابی حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*******************************************************************************************
function ConfirmDeletePhoto() 
{
	if (confirm("!عکس حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*******************************************************************************************
function ConfirmDeleteProduct() 
{
	if (confirm("!این محصول حذف خواهد شد\nآیا مطمئن هستید؟")==false)
		return false;
	else
		return true;
}
//*************************************************************************************
function LoginPan()
{
    if (document.getElementById("LoginPan").style.display=="none"){
        document.getElementById("LoginPan").style.display="block"
    }else{
        document.getElementById("LoginPan").style.display="none"
    }
}
//*************************************************************************************
function PhotoFullSize(windows) 
{
 window.open(windows,'CmsSoft','status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no ,width=800px,height=600px')
}
function popup(windows) 
{
 window.open(windows,'CmsSoft','status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no ,width=500px,height=500px')
}
//**************************************************************************************
function window_onresize() 
{
    moveObjTo(document.getElementById("flashClock"),document.getElementById("tb1").offsetLeft+192,"")
    moveObjTo(document.getElementById("flashClock"),"",document.getElementById("tb1").offsetTop-50)
    moveObjTo(document.getElementById("LogoUT"),(document.getElementById("HeaderRight").offsetLeft+(document.getElementById("HeaderRight").offsetWidth/2))-200,"")
}
function moveObjTo( obj, x, y )
{
	if ( ! obj.style )
	{
	    if(y != "") {
		    obj.top = y;
		}
		if(x != "") {
		    obj.left = x;
		}
	}
	else
	{
	    if(y != "") {
		    obj.style.top = y + "px";
		}
		if(x != "") {
		    obj.style.left = x + "px";
		}
	}
}

//**************************************************************************************
// Set Style
var BooColorSettingVisible = false
function ShowColorSeeting() {
	if (BooColorSettingVisible) {
		document.getElementById('ColorSetting').style.visibility ="hidden"
		BooColorSettingVisible = false 
	}else{
		document.getElementById('ColorSetting').style.visibility ="visible"
		BooColorSettingVisible = true
	}
}
function ChangeClassStyle(id, newClass) {
    if (id == "Body") {
        document.body.className=newClass;
    }else{
        identity=document.getElementById(id);
        identity.className=newClass;    
    }
}
function setActiveStyleSheet(title) {  var i, a, main;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {      a.disabled = true;      if(a.getAttribute("title") == title) a.disabled = false;    }  }  createCookie("CMSSOFT_SiteStyle", title, 365);}function getActiveStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");  }  return null;}function getPreferredStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1       && a.getAttribute("rel").indexOf("alt") == -1       && a.getAttribute("title")        ) return a.getAttribute("title");  }  //return 'Default'}function createCookie(name,value,days) {  if (days) {    var date = new Date();    date.setTime(date.getTime()+(days*24*60*60*1000));    var expires = "; expires="+date.toGMTString();  }  else expires = "";  document.cookie = name+"="+value+expires+"; path=/";}function readCookie( name ) {
	
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}window.onload = function(e) {  var cookie = readCookie("CMSSOFT_SiteStyle");  var title = cookie ? cookie : getPreferredStyleSheet();  setActiveStyleSheet(title);  window_onresize()}window.onunload = function(e) {  var title = getActiveStyleSheet();  createCookie("CMSSOFT_SiteStyle", title, 365);}window.onresize = function(e) {  window_onresize();}var cookie = readCookie("CMSSOFT_SiteStyle");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);
//**************************************************************************************