function isEmail(_1){
regexp=/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z-]*\.)+[a-zA-Z]{2,9})$/i;
if(regexp.test(_1)){
return true;
}else{
return false;
}
}
function isNumeric(_2){
regexp=/^[0-9]+\.[0-9]+$/;
regexpnum=/^[0-9]+$/;
if(regexp.test(_2)||regexpnum.test(_2)){
return true;
}else{
return false;
}
}
function isEmpty(_3){
if(_3==""){
return true;
}else{
return false;
}
}
function isArray(_4){
if(_4.constructor.toString().indexOf("Array")==-1){
return false;
}else{
return true;
}
}
function validateLogin(){
if(document.loginForm.user.value==""){
document.loginForm.user.focus();
document.loginForm.user.style.border="2px solid red";
createAlert("Please enter your username",true);
return false;
}
if(document.loginForm.password.value==""){
document.loginForm.password.focus();
document.loginForm.password.style.border="2px solid red";
createAlert("Please enter your password",true);
return false;
}
return true;
}
function rusure(m,_6){
Dialog.confirm(m,{windowParameters:{width:300},okLabel:"Confirm",buttonClass:"myButtonClass",id:"myDialogId",cancel:function(_7){
return false;
},ok:function(_8){
document.location=_6;
return true;
}});
}
function rusureajax(m,_a,_b,_c){
Dialog.confirm(m,{windowParameters:{width:300},okLabel:"Confirm",buttonClass:"myButtonClass",id:"myDialogId",cancel:function(_d){
return false;
},ok:function(_e){
xajax_axLoadPage(_a,_b,_c);
return true;
}});
}
function addproduct(_f){
var _f;
var x=document.getElementById("category");
for($i=0;$i<x.length;$i++){
if(x.options[$i].value==_f){
x.selectedIndex=$i;
}
}
var _11=document.getElementById("addproduct");
var _12=document.getElementById("addtext");
if(_11.style.display=="block"){
_11.style.display="none";
_12.innerHTML="Add product in this category.";
}else{
_11.style.display="block";
_12.innerHTML="Hide form.";
var fck=FCKeditorAPI.GetInstance("description");
if(fck.EditMode==FCK_EDITMODE_WYSIWYG){
fck.MakeEditable();
}
}
}
function fsinit(i){
var _15=new MultiSelector(document.getElementById("files_list"),10);
_15.addElement(document.getElementById(i));
}
function toggle(id){
ul="ul_"+id;
span="span_"+id;
ulElement=document.getElementById(ul);
spanElement=document.getElementById(span);
if(ulElement){
if(ulElement.className=="closed"){
ulElement.className="open";
spanElement.className="opened_img";
}else{
ulElement.className="closed";
spanElement.className="closed_img";
}
}
}
function showhide(id){
var lyr=getElemRefs(id);
if(lyr.css.display=="none"){
lyr.css.display="block";
}else{
lyr.css.display="none";
}
}
var origWidth,origHeight;
if(document.layers){
origWidth=window.innerWidth;
origHeight=window.innerHeight;
window.onresize=function(){
if(window.innerWidth!=origWidth||window.innerHeight!=origHeight){
history.go(0);
}
};
}
var cur_lyr;
function swapLayers(id){
if(cur_lyr){
hideLayer(cur_lyr);
}
showLayer(id);
cur_lyr=id;
}
function showLayer(id){
var lyr=getElemRefs(id);
if(lyr&&lyr.css){
lyr.css.display="block";
}
}
function hideLayer(id){
var lyr=getElemRefs(id);
if(lyr&&lyr.css){
lyr.css.display="none";
}
}
function getElemRefs(id){
var el=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:(document.layers)?document.layers[id]:null;
if(el){
el.css=(el.style)?el.style:el;
}
return el;
}
function copyToList(_20,to){
fromList=document.getElementById(_20);
toList=document.getElementById(to);
if(toList.options.length>0&&toList.options[0].value=="temp"){
toList.options.length=0;
}
var sel=false;
for(i=0;i<fromList.options.length;i++){
var _23=fromList.options[i];
if(_23.selected){
sel=true;
if(_23.value=="temp"){
alert("You cannot move this text!");
return;
}
txt=_23.text;
val=_23.value;
toList.options[toList.length]=new Option(txt,val);
fromList.options[i]=null;
i--;
}
}
if(!sel){
alert("You haven't selected any options!");
}
}
function allSelect(){
List=document.forms[0].members;
for(i=0;i<List.length;i++){
List.options[i].selected=true;
}
}
var counter=0;
function setStyle(_24,_25,_26,_27){
var _28=false;
try{
if(_24.style&&_24.style.setProperty){
_24.style.setProperty(_25,_26,_27);
_28=true;
}
}
catch(ex){
alert("exception caught setting style: "+ex.message);
}
if(!_28){
try{
_24.style[_25]=_26;
_28=true;
}
catch(exNext){
alert("exception caught setting direct style: "+exNext.message);
}
}
return _28;
}
var gFocusItem=null;
function doFocus(){
try{
if(gFocusItem!=null){
gFocusItem.focus();
gFocusItem=null;
}
}
catch(error){
alert("DEBUG: error in doFocus()");
}
}
function createAlert(_29,_2a){
Dialog.alert(_29,{windowParameters:{className:"alphacube",width:300,height:100},okLabel:"Ok"});
}
function OLDcreateAlert(_2b,_2c){
var _2d=document.createElement("div");
_2d.setAttributeNS("http://www.w3.org/TR/xhtml2","role","wairole:alert");
var _2e="alert"+counter++;
_2d.setAttribute("id",_2e);
_2d.setAttribute("tabindex","-1");
_2d.setAttribute("class","alert");
setStyle(_2d,"display","block","");
var _2f=document.createTextNode(_2b);
_2d.appendChild(_2f);
var _30=document.createElement("a");
_30.setAttribute("onclick","closeAlert('"+_2e+"');");
_30.setAttribute("href","#");
var _31=document.createTextNode("close");
_30.appendChild(_31);
var _32=document.createElement("div");
setStyle(_32,"clear","both","");
setStyle(_32,"text-align","right","");
setStyle(_32,"margin-top","5px","");
_32.appendChild(_30);
_2d.appendChild(_32);
var _33=document.getElementById("alertParent");
_33.appendChild(_2d);
if(_2c){
gFocusItem=_2d;
setTimeout("doFocus();",0);
}
return false;
}
function closeAlert(_34){
var _35=document.getElementById(_34);
setStyle(_35,"display","none","");
var _36=document.getElementById("alertParent");
_36.removeChild(_35);
}
function addLoadEvent(_37){
var _38=window.onload;
if(typeof window.onload!="function"){
window.onload=_37;
}else{
window.onload=function(){
_38();
_37();
};
}
}
var emod;
var alt=false;
var ctrl=false;
var shift=false;
var key=false;
function onKeyDownH(e){
switch(emod){
case "IE4+":
e=window.event;
alt=(e.altKey)?true:false;
ctrl=(e.ctrlKey)?true:false;
shift=(e.shiftKey)?true:false;
break;
case "NN4":
alt=((e.modifiers&Event.ALT_MASK)==Event.ALT_MASK);
ctrl=((e.modifiers&Event.CTRL_MASK)==Event.CTRL_MASK);
shift=((e.modifiers&Event.SHIFT_MASK)==Event.SHIFT_MASK);
break;
case "W3C":
alt=(e.altKey)?true:false;
ctrl=(e.ctrlKey)?true:false;
shift=(e.shiftKey)?true:false;
break;
default:
if(e.target){
alt=(e.altKey)?true:false;
ctrl=(e.ctrlKey)?true:false;
shift=(e.shiftKey)?true:false;
}
break;
}
if(e.keyCode){
key=e.keyCode;
}
return key;
}
function onloadH(e){
emod=(e)?(e.eventPhase)?"W3C":"NN4":(window.event)?"IE4+":"unknown";
if(emod=="NN4"){
document.captureEvents(Event.KEYDOWN);
}
document.onkeydown=onKeyDownH;
return true;
}
addLoadEvent(onloadH);
function jxdelRow(id,_3c){
if(key=="68"){
xajax_delRow(id,_3c);
}
}
function delRow(id){
Fat.fade_element(id,null,700,"#FF3333");
setTimeout("document.getElementById('"+id+"').style.display= 'none';",800);
}
function windowPopUp(id,_3f,_40){
var win=new Window(id,{className:"alphacube",title:_3f,top:40,left:160,width:900,height:580,resizable:true,url:_40,showEffectOptions:{duration:1}});
win.setDestroyOnClose();
win.showCenter(true);
win.show();
}
function cmsbg(_42){
var _43=document.getElementById("cmsImage");
if(_42!=""){
_43.style.background="url("+_42+") no-repeat";
}
}
function popUp(URL,_45,_46,_47){
day=new Date();
window.open(URL,"newOne","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+_46+",height="+_47);
}
function creatediv(t){
var _49=document.createElement("div");
_49.innerHTML=t;
_49.id=oldtooltip.id;
_49.style.visibility="visible";
con=document.getElementById("container");
document.body.insertBefore(_49,con);
}
function selectit(_4a){
var v=eval("document.forms[0]."+_4a);
if(v.checked){
v.checked=false;
}else{
v.checked=true;
}
}
function checkUncheckAll(_4c){
var _4d=_4c.form,z=0;
for(z=0;z<_4d.length;z++){
if(_4d[z].type=="checkbox"){
if(_4d[z].checked){
_4d[z].checked=false;
}else{
_4d[z].checked=true;
}
}
}
}
function getfck(frm,id){
var val=get_ed_text(id);
frm.elements[id].value=val;
}
function get_ed_text(_52){
var _53=FCKeditorAPI.GetInstance(_52);
if(_53.EditorDocument.body.innerHTML){
return _53.EditorDocument.body.innerHTML;
}else{
return "";
}
}
function tinyadd(id,_55,_56){
var i=new Array();
i["title"]=_55;
i["img"]="/local/image.php?id="+id;
i["thumb"]="/local/image.php?id="+id+"&x=100&y=100&zc=1";
var out="";
if(_56=="thumblinked"){
out+="<a href rel='lightbox' title='"+i["title"]+"' href='"+i["img"]+"'>";
out+="<img border='0' alt='"+i["title"]+"' src='"+i["thumb"]+"' width='100'>";
out+="</a>";
}
if(_56=="thumbnotlinked"){
out+="<img border='0' alt='"+i["title"]+"' src='"+i["thumb"]+"' width='100'>";
}
if(_56=="original"){
out+="<img border='0' alt='"+i["title"]+"' src='"+i["img"]+"'>";
}
if(_56=="file"){
out+="<a href='"+i["img"]+"' title='"+_55+"'>"+_55+"</a>";
}
if(_56=="url"){
out+="<a href='"+id+"' title='"+_55+"'>"+_55+"</a>";
}
out+="";
window.parent.tinyMCE.execInstanceCommand("mce_editor_0","mceInsertContent",false,out);
}

