var niftyOk=(document.getElementById&&document.createElement&&Array.prototype.push);
var niftyCss=false;
String.prototype.find=function(what){
return(this.indexOf(what)>=0?true:false);
};
var oldonload=window.onload;
if(typeof(NiftyLoad)!='function')
NiftyLoad=function(){
};
if(typeof(oldonload)=='function'){
window.onload=function(){
oldonload();
AddCss();
NiftyLoad()
};
}else{
window.onload=function(){
AddCss();
NiftyLoad()
};
};
function AddCss(){
niftyCss=true;
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
var url=new String(
((window.WAROOT_URL!=null)?window.WAROOT_URL:'')
+((window.CONF_ON_WEBASYST!=null&&window.CONF_ON_WEBASYST)?''
:'published/')
+"common/html/cssbased/geometry/rounded/niftyCorners.css");
l.setAttribute("href",url);
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
};
function Nifty(selector,options){
if(niftyOk==false)
return;
if(niftyCss==false)
AddCss();
var i,v=selector.split(","),h=0;
if(options==null)
options="";
if(options.find("fixed-height"))
try{
h=getElementsBySelector(v[0])[0].offsetHeight;
}catch(e){
h=0;
}
for(i=0;i<v.length;i++)
Rounded(v[i],options);
if(options.find("height"))
SameHeight(selector,h);
};
function Rounded(selector,options){
var i,top="",bottom="",v=new Array();
if(options!=""){
options=options.replace("left","tl bl");
options=options.replace("right","tr br");
options=options.replace("top","tr tl");
options=options.replace("bottom","br bl");
options=options.replace("transparent","alias");
if(options.find("tl")){
top="both";
if(!options.find("tr"))
top="left";
}else if(options.find("tr"))
top="right";
if(options.find("bl")){
bottom="both";
if(!options.find("br"))
bottom="left";
}else if(options.find("br"))
bottom="right";
}
if(top==""&&bottom==""&&!options.find("none")){
top="both";
bottom="both";
}
v=getElementsBySelector(selector);
for(i=0;i<v.length;i++){
FixIE(v[i]);
if(top!="")
AddTop(v[i],top,options);
if(bottom!="")
AddBottom(v[i],bottom,options);
}
};
function AddTop(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias")||(color=getBk(el))=="transparent"){
color="transparent";
bk="transparent";
border=getParentBk(el);
btype="t";
}else{
bk=getParentBk(el);
border=Mix(color,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Top");
if(options.find("small")){
d.style.marginBottom=(p-2)+"px";
btype+="s";
lim=2;
}else if(options.find("big")){
d.style.marginBottom=(p-10)+"px";
btype+="b";
lim=8;
}else
d.style.marginBottom=(p-5)+"px";
for(i=1;i<=lim;i++)
d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingTop="0";
el.insertBefore(d,el.firstChild);
};
function AddBottom(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias")||(color=getBk(el))=="transparent"){
color="transparent";
bk="transparent";
border=getParentBk(el);
btype="t";
}else{
bk=getParentBk(el);
border=Mix(color,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Bottom");
if(options.find("small")){
d.style.marginTop=(p-2)+"px";
btype+="s";
lim=2;
}else if(options.find("big")){
d.style.marginTop=(p-10)+"px";
btype+="b";
lim=8;
}else
d.style.marginTop=(p-5)+"px";
for(i=lim;i>0;i--)
d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingBottom=0;
el.appendChild(d);
};
function CreateStrip(index,side,color,border,btype){
var x=CreateEl("b");
x.className=btype+index;
x.style.backgroundColor=color;
x.style.borderColor=border;
if(side=="left"){
x.style.borderRightWidth="0";
x.style.marginRight="0";
}else if(side=="right"){
x.style.borderLeftWidth="0";
x.style.marginLeft="0";
}
return(x);
};
function CreateEl(x){
return(document.createElement(x));
};
function FixIE(el){
if(el.currentStyle!=null&&el.currentStyle.hasLayout!=null
&&el.currentStyle.hasLayout==false)
el.style.display="inline-block";
};
function SameHeight(selector,maxh){
var i,v=selector.split(","),t,j,els=[],gap;
for(i=0;i<v.length;i++){
t=getElementsBySelector(v[i]);
els=els.concat(t);
}
for(i=0;i<els.length;i++){
if(els[i].offsetHeight>maxh)
maxh=els[i].offsetHeight;
els[i].style.height="auto";
}
for(i=0;i<els.length;i++){
gap=maxh-els[i].offsetHeight;
if(gap>0){
t=CreateEl("b");
t.className="niftyfill";
t.style.height=gap+"px";
nc=els[i].lastChild;
if(nc.className=="niftycorners")
els[i].insertBefore(t,nc);
else
els[i].appendChild(t);
}
}
};
function getElementsBySelector(selector){
var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;
if(selector.find("#")){
if(selector.find(" ")){
s=selector.split(" ");
var fs=s[0].split("#");
if(fs.length==1)
return(objlist);
f=document.getElementById(fs[1]);
if(f){
v=f.getElementsByTagName(s[1]);
for(i=0;i<v.length;i++)
objlist.push(v[i]);
}
return(objlist);
}else{
s=selector.split("#");
tag=s[0];
selid=s[1];
if(selid!=""){
f=document.getElementById(selid);
if(f)
objlist.push(f);
return(objlist);
}
}
}
if(selector.find(".")){
s=selector.split(".");
tag=s[0];
selclass=s[1];
if(selclass.find(" ")){
s=selclass.split(" ");
selclass=s[0];
tag2=s[1];
}
}
var v=document.getElementsByTagName(tag);
if(selclass==""){
for(i=0;i<v.length;i++)
objlist.push(v[i]);
return(objlist);
}
for(i=0;i<v.length;i++){
c=v[i].className.split(" ");
for(j=0;j<c.length;j++){
if(c[j]==selclass){
if(tag2=="")
objlist.push(v[i]);
else{
v2=v[i].getElementsByTagName(tag2);
for(k=0;k<v2.length;k++)
objlist.push(v2[k]);
}
}
}
}
return(objlist);
};
function getParentBk(x){
var el=x.parentNode,c;
while(el.tagName.toUpperCase()!="HTML"
&&(c=getBk(el))=="transparent")
el=el.parentNode;
if(c=="transparent")
c="#FFFFFF";
if(c=="white")
c="#FFFFFF";
return(c);
};
function getBk(x){
var c=getStyleProp(x,"backgroundColor");
if(c==null||c=="transparent"||c.find("rgba(0, 0, 0, 0)"))
return("transparent");
if(c.find("rgb"))
c=rgb2hex(c);
return(c);
};
function getPadding(x,side){
var p=getStyleProp(x,"padding"+side);
if(p==null||!p.find("px"))
return(0);
return(parseInt(p));
};
function getStyleProp(x,prop){
if(x.currentStyle)
return(x.currentStyle[prop]);
if(document.defaultView.getComputedStyle)
return(document.defaultView.getComputedStyle(x,'')[prop]);
return(null);
};
function rgb2hex(value){
var hex="",v,h,i;
var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;
var h=regexp.exec(value);
for(i=1;i<4;i++){
v=parseInt(h[i]).toString(16);
if(v.length==1)
hex+="0"+v;
else
hex+=v;
}
return("#"+hex);
};
function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)
step1=1;
else
step1=2;
if(c2.length==4)
step2=1;
else
step2=2;
for(i=0;i<3;i++){
x=parseInt(c1.substr(1+step1*i,step1),16);
if(step1==1)
x=16*x+x;
y=parseInt(c2.substr(1+step2*i,step2),16);
if(step2==1)
y=16*y+y;
r[i]=Math.floor((x*50+y*50)/100);
r[i]=r[i].toString(16);
if(r[i].length==1)
r[i]="0"+r[i];
}
if(r[0]=='NaN'){
}
return("#"+r[0]+r[1]+r[2]);
};
jQuery.cookie=function(key,value,options){
if(arguments.length>1&&(value===null||typeof value!=="object")){
options=jQuery.extend({},options);
if(value===null){
options.expires=-1;
}
if(typeof options.expires==='number'){
var days=options.expires,t=options.expires=new Date();
t.setDate(t.getDate()+days);
}
return(document.cookie=[
encodeURIComponent(key),'=',
options.raw?String(value):encodeURIComponent(String(value)),
options.expires?'; expires='+options.expires.toUTCString():'',
options.path?'; path='+options.path:'',
options.domain?'; domain='+options.domain:'',
options.secure?'; secure':''
].join(''));
}
options=value||{};
var result,decode=options.raw?function(s){return s;}:decodeURIComponent;
return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;
};
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.1g.1w=6(o){o=$.1f({r:n,x:n,N:n,17:q,J:n,L:1a,16:n,y:q,u:12,H:3,B:0,k:1,K:n,I:n},o||{});8 G.R(6(){p b=q,A=o.y?"15":"w",P=o.y?"t":"s";p c=$(G),9=$("9",c),E=$("10",9),W=E.Y(),v=o.H;7(o.u){9.1h(E.D(W-v-1+1).V()).1d(E.D(0,v).V());o.B+=v}p f=$("10",9),l=f.Y(),4=o.B;c.5("1c","H");f.5({U:"T",1b:o.y?"S":"w"});9.5({19:"0",18:"0",Q:"13","1v-1s-1r":"S","z-14":"1"});c.5({U:"T",Q:"13","z-14":"2",w:"1q"});p g=o.y?t(f):s(f);p h=g*l;p j=g*v;f.5({s:f.s(),t:f.t()});9.5(P,h+"C").5(A,-(4*g));c.5(P,j+"C");7(o.r)$(o.r).O(6(){8 m(4-o.k)});7(o.x)$(o.x).O(6(){8 m(4+o.k)});7(o.N)$.R(o.N,6(i,a){$(a).O(6(){8 m(o.u?o.H+i:i)})});7(o.17&&c.11)c.11(6(e,d){8 d>0?m(4-o.k):m(4+o.k)});7(o.J)1p(6(){m(4+o.k)},o.J+o.L);6 M(){8 f.D(4).D(0,v)};6 m(a){7(!b){7(o.K)o.K.Z(G,M());7(o.u){7(a<=o.B-v-1){9.5(A,-((l-(v*2))*g)+"C");4=a==o.B-v-1?l-(v*2)-1:l-(v*2)-o.k}F 7(a>=l-v+1){9.5(A,-((v)*g)+"C");4=a==l-v+1?v+1:v+o.k}F 4=a}F{7(a<0||a>l-v)8;F 4=a}b=12;9.1o(A=="w"?{w:-(4*g)}:{15:-(4*g)},o.L,o.16,6(){7(o.I)o.I.Z(G,M());b=q});7(!o.u){$(o.r+","+o.x).1n("X");$((4-o.k<0&&o.r)||(4+o.k>l-v&&o.x)||[]).1m("X")}}8 q}})};6 5(a,b){8 1l($.5(a[0],b))||0};6 s(a){8 a[0].1k+5(a,\'1j\')+5(a,\'1i\')};6 t(a){8 a[0].1t+5(a,\'1u\')+5(a,\'1e\')}})(1x);',62,96,'||||curr|css|function|if|return|ul|||||||||||scroll|itemLength|go|null||var|false|btnPrev|width|height|circular||left|btnNext|vertical||animCss|start|px|slice|tLi|else|this|visible|afterEnd|auto|beforeStart|speed|vis|btnGo|click|sizeCss|position|each|none|hidden|overflow|clone|tl|disabled|size|call|li|mousewheel|true|relative|index|top|easing|mouseWheel|padding|margin|200|float|visibility|append|marginBottom|extend|fn|prepend|marginRight|marginLeft|offsetWidth|parseInt|addClass|removeClass|animate|setInterval|0px|type|style|offsetHeight|marginTop|list|jCarouselLite|jQuery'.split('|'),0,{}))
var BrowserDetect={
init:function(){
this.browser=this.searchString(this.dataBrowser)||"An unknown browser";
this.version=this.searchVersion(navigator.userAgent)
||this.searchVersion(navigator.appVersion)
||"an unknown version";
this.OS=this.searchString(this.dataOS)||"an unknown OS";
},
searchString:function(data){
for(var i=0;i<data.length;i++){
var dataString=data[i].string;
var dataProp=data[i].prop;
this.versionSearchString=data[i].versionSearch||data[i].identity;
if(dataString){
if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;
}
else if(dataProp)
return data[i].identity;
}
},
searchVersion:function(dataString){
var index=dataString.indexOf(this.versionSearchString);
if(index==-1)return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
dataBrowser:[
{
string:navigator.vendor,
subString:"Apple",
identity:"Safari"
}
],
dataOS:[]
};
function roundElems(){
BrowserDetect.init();
if(BrowserDetect.browser=='Safari'){
var oldonload=window.onload;
window.onload=function(){
if(oldonload)oldonload();
Nifty("div#cat_advproduct_search","");
}
}else{
Nifty("div#cat_advproduct_search","");
}
}
function getElementComputedStyle(elem,prop){
if(typeof elem!="object"){
elem=document.getElementById(elem);
}
if(document.defaultView&&document.defaultView.getComputedStyle){
if(prop.match(/[A-Z]/)){
prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();
}
return document.defaultView.getComputedStyle(elem,"")
.getPropertyValue(prop);
}
if(elem.currentStyle){
var i;
while((i=prop.indexOf("-"))!=-1){
prop=prop.substr(0,i)+prop.substr(i+1,1).toUpperCase()
+prop.substr(i+2);
}
return elem.currentStyle[prop];
}
return"";
}
function getWindowSize(wnd){
var windowWidth,windowHeight;
if(wnd.innerHeight){
if(wnd.document.documentElement.clientWidth){
windowWidth=wnd.document.documentElement.clientWidth;
}else{
wnd.windowWidth=wnd.innerWidth;
}
windowHeight=wnd.innerHeight;
}else if(wnd.document.documentElement
&&wnd.document.documentElement.clientHeight){
windowWidth=wnd.document.documentElement.clientWidth;
windowHeight=wnd.document.documentElement.clientHeight;
}else if(wnd.document.body){
windowWidth=wnd.document.body.clientWidth;
windowHeight=wnd.document.body.clientHeight;
}
return[windowWidth,windowHeight];
}
function number_format(a,b,c,d){
a=Math.round(a*Math.pow(10,b))/Math.pow(10,b);
e=a+'';
f=e.split('.');
if(!f[0]){
f[0]='0';
}
if(!f[1]){
f[1]='';
}
if(f[1].length<b){
g=f[1];
for(i=f[1].length+1;i<=b;i++){
g+='0';
}
f[1]=g;
}
if(d!=''&&f[0].length>3){
h=f[0];
f[0]='';
for(j=3;j<h.length;j+=3){
i=h.slice(h.length-j,h.length-j+3);
f[0]=d+i+f[0]+'';
}
j=h.substr(0,(h.length%3==0)?3:(h.length%3));
f[0]=j+f[0];
}
c=(b<=0)?'':c;
return f[0]+c+f[1];
}
function getLayer(layerName,pwindow){
if(!pwindow){
pwindow=window;
}
if(pwindow.document.getElementById){
return pwindow.document.getElementById(layerName);
}
if(pwindow.document.all)
return pwindow.document.all[layerName];
if(pwindow.document.layers)
return pwindow.document.layers[layerName];
return null;
}
function changeState(id_name,state){
var layer=getLayer(id_name);
if(is_null(layer))
return;
if(is_null(state)?layer.style.display!='block':state){
layer.style.display='block';
}else{
layer.style.display='none';
}
}
function is_null(obj){
if(typeof(obj)=='undefined')
return true;
if(obj==null)
return true;
return false;
}
function getAbsolutePos(el){
var SL=0,ST=0;
var is_div=/^div$/i.test(el.tagName);
if(is_div&&el.scrollLeft)
SL=el.scrollLeft;
if(is_div&&el.scrollTop)
ST=el.scrollTop;
var r={
x:el.offsetLeft-SL,
y:el.offsetTop-ST
};
if(el.offsetParent){
var tmp=this.getAbsolutePos(el.offsetParent);
r.x+=tmp.x;
r.y+=tmp.y;
}
return r;
}
function getElementsByClass(searchClass,node,tag){
var classElements=new Array();
if(node==null)
node=document;
if(tag==null)
tag='*';
var els=node.getElementsByTagName(tag);
var elsLen=els.length;
var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for(var i=0,j=0;i<elsLen;i++){
if(pattern.test(els[i].className)){
classElements[j]=els[i];
j++;
}
}
return classElements;
}
function getElementByClass(searchClass,node,tag){
var elems=getElementsByClass(searchClass,node,tag);
if(!elems.length)
return null;
return elems[0];
}
function createTag(tag,pel,wnd){
if(!wnd)
wnd=window;
if(!pel)
pel=wnd.document.body;
el=wnd.document.createElement(tag);
pel.appendChild(el);
return el;
}
function deleteTag(element,parent){
if(!parent)
parent=element.parentNode;
parent.removeChild(element);
}
function open_window(link,w,h){
var win="width="+w+",height="+h
+",menubar=no,location=no,resizable=yes,scrollbars=yes";
var newWin=window.open(link,'newWin',win);
if(newWin){
newWin.focus();
}
return newWin;
}
function select_getCurrValue(selectEntry){
for(var i=0;i<selectEntry.options.length;i++){
if(selectEntry.options[i].selected){
return selectEntry.options[i].value;
}
}
return null;
}
function select_getCurrOption(selectEntry){
for(var i=0;i<selectEntry.options.length;i++){
if(selectEntry.options[i].selected){
return selectEntry.options[i];
}
}
return null;
}
function select_selectOptionByValue(selectEntry,value){
for(var i=0;i<selectEntry.options.length;i++){
selectEntry.options[i].selected=(value==selectEntry.options[i].value);
}
}
function select_getOptionByValue(selectEntry,value){
for(var i=0;i<selectEntry.options.length;i++){
if(selectEntry.options[i].value==value)
return selectEntry.options[i];
}
return null;
}
function findSelectedIndex(ob){
for(i=0;i<ob.length;i++){
if(ob[i].selected)
return i;
}
return-1;
}
function select_addOption(oListbox,text,value,isDefaultSelected,isSelected){
var oOption=document.createElement("option");
oOption.appendChild(document.createTextNode(text));
oOption.setAttribute("value",value);
if(isDefaultSelected)
oOption.defaultSelected=true;
else if(isSelected)
oOption.selected=true;
oListbox.appendChild(oOption);
}
function confirmDelete(id,ask,url){
if(window.confirm(ask)){
window.location=url+id;
}
}
function formatPrice(price){
return defaultCurrency.getView(price);
}
function allowInsertAtCarret(field){
return document.selection
||(field.selectionStart||field.selectionStart=='0')||false;
}
function insertAtCarret(field,value){
if(document.selection){
field.focus();
sel=document.selection.createRange();
sel.text=value;
}else if(field.selectionStart||field.selectionStart=='0'){
var startPos=field.selectionStart;
var endPos=field.selectionEnd;
var scrollTop=field.scrollTop;
field.value=field.value.substring(0,startPos)+value
+field.value.substring(endPos,field.value.length);
field.focus();
var cPos=startPos+(value.length);
field.selectionStart=cPos;
field.selectionEnd=cPos;
field.scrollTop=scrollTop;
}else{
field.value+="\n"+value;
}
if(field.createTextRange){
field.caretPos=document.selection.createRange().duplicate();
}
}
FadeSteps=["ff","ee","dd","cc","bb","aa","99"];
FadeTimeout=600;
function fadeBlock(targetId){
DoFade(FadeSteps.length-1,targetId);
}
function DoFade(colorId,targetId){
if(colorId>=0&&document.getElementById(targetId)){
document.getElementById(targetId).style.backgroundColor="#ffff"
+FadeSteps[colorId];
colorId--;
setTimeout("DoFade("+colorId+",'"+targetId+"')",FadeTimeout);
}else if(document.getElementById(targetId).getAttribute('obj_wnd')){
document.getElementById(targetId).getAttribute('obj_wnd').close();
}
}
function __alert(message){
var _msg=new Message();
_msg.__type=MSGTYPE_SUCCESS;
_msg.__message=message;
_msg.showMessage();
}
var MSGTYPE_SUCCESS=1;
var MSGTYPE_ERROR=2;
var Message=function(){
this.__type=null;
this.__code=null;
this.__message=null;
this.__params=null;
this.init=function(data){
if(data.type)
this.__type=data.type;
if(data.code)
this.__code=data.code;
if(data.message)
this.__message=data.message;
if(data.params)
this.__params=data.params;
};
this.isError=function(){
return this.__type==MSGTYPE_ERROR;
};
this.isSuccess=function(){
return this.__type==MSGTYPE_SUCCESS;
};
this.getMessage=function(){
return this.__message;
};
this.getParams=function(){
return this.__params;
};
this.showMessage=function(){
var msgWnd=new wnd();
msgWnd.move(100,100);
msgWnd.setWidth(400);
var messageBlock=msgWnd.getContentObj();
messageBlock.className=this.isSuccess()
?"success_block"
:"error_block";
messageBlock.innerHTML=this.getMessage();
messageBlock.id='wnd-msg-block';
messageBlock.style.position='fixed';
w_size=getWindowSize(window);
w1_size=msgWnd.getSize();
msgWnd.move((w_size[0]-w1_size[0])/2,(w_size[1]-w1_size[1])/4);
msgWnd.show();
msgWnd.fade();
};
};
var wnd=function(){
if(getLayer('wnd-init')){
this.__objDiv=getLayer('wnd-init');
this.__objDiv.parentNode.removeChild(this.__objDiv);
}
this.__objDiv=createTag('div');
this.__objDiv.id='wnd-init';
this.__objDiv.className='wnd_init';
this.__objDiv.setAttribute('obj_wnd',this);
var objWnd=this;
this.__objContent=createTag('div',this.__objDiv);
this.fade=function(){
setTimeout("getLayer('"+this.__objDiv.id
+"').style.display = 'none'",5000);
};
this.getSize=function(){
return[this.__objDiv.offsetWidth,this.__objDiv.offsetHeight];
};
this.getContentObj=function(){
return this.__objContent;
};
this.setWidth=function(w){
this.__objDiv.style.width=w+'px';
};
this.setHeight=function(h){
this.__objDiv.style.height=h+'px';
};
this.show=function(){
this.__objDiv.style.visibility='visible';
};
this.hide=function(){
this.__objDiv.style.visibility='hidden';
};
this.close=function(){
this.hide();
this.__objDiv.parentNode.removeChild(this.__objDiv);
};
this.move=function(x,y){
this.__objDiv.style.left=x+"px";
this.__objDiv.style.top=y+"px";
};
};
function getFormByElem(elem){
var max=50;
var p=elem.parentNode;
while(p&&p.tagName&&!(/^form$/i.test(p.tagName))&&0<max--){
p=p.parentNode;
}
if(p&&p.tagName&&/^form$/i.test(p.tagName))
return p;
return null;
}
function getCookie(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));
}
function setCookie(name,value,expires,path,domain,secure){
var today=new Date();
today.setTime(today.getTime());
if(expires){
expires=expires*1000*60*60*24;
}
var expires_date=new Date(today.getTime()+(expires));
document.cookie=name+'='
+escape(value)
+((expires)?';expires='+expires_date.toGMTString():'')
+
((path)?';path='+path:'')
+((domain)?';domain='+domain:'')
+((secure)?';secure':'');
}
function deleteCookie(name,path,domain){
if(getCookie(name))
document.cookie=name+'='+((path)?';path='+path:'')
+((domain)?';domain='+domain:'')
+';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}
function catchResult(e){
alert(e);
}
function openFadeIFrame(url,caption){
sswgt_CartManager.shop_url=(window.WAROOT_URL!=null)
?window.WAROOT_URL
:ORIG_URL;
sizes=getPageSize();
sswgt_CartManager.show(url,sizes[0]*0.7,sizes[1]*0.7);
}
function resizeFadeIFrame(width,height){
sswgt_CartManager.resizeFrame(width,height);
}
function closeFadeIFrame(){
sswgt_CartManager.hide();
}
function split_query(query){
var gets=query.split(/\&/);
var q_get={};
var t=null;
for(var i=gets.length-1;i>=0;i--){
t=gets[i].split(/\=/);
if(t[0]!=null){
q_get[t[0]]=t[1]?t[1]:'';
}
}
return q_get;
}
function set_query(query,url){
if(!url)
url=document.location.href;
var reg=/([^\?]*)\?([^\#]*)(|\#.*)$/;
var results=url.match(reg);
var path_part=results&&results[1]?results[1]:'';
var get_part=results&&results[2]?results[2]:'';
var anchor_part=results&&results[3]?results[3]:'';
var mode=query.search(/^\?/)==-1?'update':'new';
query=query.replace(/^\?|^\&/,'');
var q_get=split_query(query);
var u_get=split_query(get_part);
var new_query='';
if(mode=='update'){
for(var k in q_get){
u_get[k]=q_get[k]?q_get[k]:null;
}
}else{
for(var k in q_get){
if(!q_get[k])
q_get[k]=u_get[k]?u_get[k]:null;
}
u_get=q_get;
}
for(var k in u_get){
if(k&&(u_get[k]!=null))
new_query+='&'+k+'='+u_get[k];
}
return'?'+new_query.replace(/^\&/,'')+anchor_part;
}
var AjaxCptHndls={
__handlers:{},
register:function(event_name,cpt_id,handler){
if(is_null(this.__handlers[cpt_id]))
this.__handlers[cpt_id]={};
this.__handlers[cpt_id][event_name]=handler;
},
call:function(event_name,cpt_id,data){
if(is_null(this.__handlers[cpt_id][event_name]))
return;
return this.__handlers[cpt_id][event_name](data);
}
};
function getEventObject(ev){
var my_ev={};
ev=ev?ev:window.event;
if(ev.srcElement){
my_ev.target=ev.srcElement;
}else{
my_ev.target=ev.target;
}
my_ev.ev=ev;
return my_ev;
}
function getPageSize(){
var xScroll,yScroll;
if(window.innerHeight&&window.scrollMaxY){
xScroll=window.innerWidth+window.scrollMaxX;
yScroll=window.innerHeight+window.scrollMaxY;
}else if(document.body.scrollHeight>document.body.offsetHeight){
xScroll=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
xScroll=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
var windowWidth,windowHeight;
if(self.innerHeight){
if(document.documentElement.clientWidth){
windowWidth=document.documentElement.clientWidth;
}else{
windowWidth=self.innerWidth;
}
windowHeight=self.innerHeight;
}else if(document.documentElement
&&document.documentElement.clientHeight){
windowWidth=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else if(document.body){
windowWidth=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
if(yScroll<windowHeight){
pageHeight=windowHeight;
}else{
pageHeight=yScroll;
}
if(xScroll<windowWidth){
pageWidth=xScroll;
}else{
pageWidth=windowWidth;
}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
}
var beforeUnloadHandler_contentChanged=false;
var beforeUnloadHandler=function(){
if(beforeUnloadHandler_contentChanged)
return translate.msg_unsaved_changes;
if(window.tinyMCE){
var anyDirty=false;
for(var n in tinyMCE.instances){
var inst=tinyMCE.instances[n];
if(!tinyMCE.isInstance(inst))
continue;
if(inst.isDirty())
return translate.msg_unsaved_changes;
}
}
return;
};
function getCookie(c_name){
if(document.cookie.length>0){
c_start=document.cookie.indexOf(c_name+"=");
if(c_start!=-1){
c_start=c_start+c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if(c_end==-1)
c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return null;
}
function setCookie(c_name,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+"="+escape(value)
+((expiredays==null)?"":";expires="+exdate.toGMTString());
}
window.onbeforeunload=beforeUnloadHandler;
var Behaviour={
list:new Array,
register:function(sheet){
Behaviour.list.push(sheet);
},
start:function(){
Behaviour.addLoadEvent(function(){
Behaviour.apply();
});
},
apply:function(){
for(h=0;sheet=Behaviour.list[h];h++){
for(selector in sheet){
list=document.getElementsBySelector(selector);
if(!list){
continue;
}
for(i=0;element=list[i];i++){
sheet[selector](element);
}
}
}
},
addLoadEvent:function(func){
var oldonload=window.onload;
if(typeof window.onload!='function'){
window.onload=func;
}else{
window.onload=function(){
try{
if(typeof oldonload=='function')oldonload();
}catch(e){;}finally{;}
try{
if(typeof func=='function')func();
}catch(e){;}finally{;}
}
}
}
}
Behaviour.start();
function getAllChildren(e){
return e.all?e.all:e.getElementsByTagName('*');
}
document.getElementsBySelector=function(selector){
if(!document.getElementsByTagName){
return new Array();
}
var tokens=selector.split(' ');
var currentContext=new Array(document);
for(var i=0;i<tokens.length;i++){
token=tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
if(token.indexOf('#')>-1){
var bits=token.split('#');
var tagName=bits[0];
var id=bits[1];
var element=document.getElementById(id);
if(tagName&&element.nodeName.toLowerCase()!=tagName){
return new Array();
}
currentContext=new Array(element);
continue;
}
if(token.indexOf('.')>-1){
var bits=token.split('.');
var tagName=bits[0];
var className=bits[1];
if(!tagName){
tagName='*';
}
var found=new Array;
var foundCount=0;
for(var h=0;h<currentContext.length;h++){
var elements;
if(tagName=='*'){
elements=getAllChildren(currentContext[h]);
}else{
elements=currentContext[h].getElementsByTagName(tagName);
}
for(var j=0;j<elements.length;j++){
found[foundCount++]=elements[j];
}
}
currentContext=new Array;
var currentContextIndex=0;
for(var k=0;k<found.length;k++){
if(found[k].className&&found[k].className.match(new RegExp('\\b'+className+'\\b'))){
currentContext[currentContextIndex++]=found[k];
}
}
continue;
}
if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){
var tagName=RegExp.$1;
var attrName=RegExp.$2;
var attrOperator=RegExp.$3;
var attrValue=RegExp.$4;
if(!tagName){
tagName='*';
}
var found=new Array;
var foundCount=0;
for(var h=0;h<currentContext.length;h++){
var elements;
if(tagName=='*'){
elements=getAllChildren(currentContext[h]);
}else{
elements=currentContext[h].getElementsByTagName(tagName);
}
for(var j=0;j<elements.length;j++){
found[foundCount++]=elements[j];
}
}
currentContext=new Array;
var currentContextIndex=0;
var checkFunction;
switch(attrOperator){
case'=':
checkFunction=function(e){return(e.getAttribute(attrName)==attrValue);};
break;
case'~':
checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b')));};
break;
case'|':
checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?')));};
break;
case'^':
checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)==0);};
break;
case'$':
checkFunction=function(e){return(e.getAttribute(attrName).lastIndexOf(attrValue)==e.getAttribute(attrName).length-attrValue.length);};
break;
case'*':
checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)>-1);};
break;
default:
checkFunction=function(e){return e.getAttribute(attrName);};
}
currentContext=new Array;
var currentContextIndex=0;
for(var k=0;k<found.length;k++){
if(checkFunction(found[k])){
currentContext[currentContextIndex++]=found[k];
}
}
continue;
}
if(!currentContext[0]){
return;
}
tagName=token;
var found=new Array;
var foundCount=0;
for(var h=0;h<currentContext.length;h++){
var elements=currentContext[h].getElementsByTagName(tagName);
for(var j=0;j<elements.length;j++){
found[foundCount++]=elements[j];
}
}
currentContext=found;
}
return currentContext;
}
if(!sswgt_CartManager){
var sswgt_CartManager={
'prefix':'my_',
'mode':'frame',
'add2cart':function(objA){
this.shop_url=objA.getAttribute('rel');
sizes=getPageSize();
this.show(objA.href+'&widgets=1',sizes[2]*0.7,sizes[3]*0.7);
return false;
},
'go2cart':function(objA){
this.shop_url=objA.getAttribute('rel');
sizes=getPageSize();
this.show(objA.href,sizes[2]*0.7,sizes[3]*0.7);
return false;
},
'_show':function(width,height){
this.hide(true);
hideSelectBoxes();
hideFlash();
this.div();
this.base();
if(this.mode=='frame'){
this.frame(this.params.url,width,height);
}else if(this.mode=='layer'){
this.layer(this.params.layer_id,width,height);
}
this.border(this.objMain);
this.closeButton(this.objBorder);
var old_onresize=window.onresize;
window.onresize=function(){
with(sswgt_CartManager){
if(!(objOverlay&&objDiv)){return;}
var arrayPageSize=getPageSize();
objOverlay.style.width=arrayPageSize[2]+'px';
objOverlay.style.height=arrayPageSize[3]+'px';
objBase.style.width=arrayPageSize[2]+'px';
objBase.style.height=arrayPageSize[3]+'px';
if(sswgt_CartManager.mode=='frame'){
sswgt_CartManager.frame(null,frameWidth,frameHeight);
}else{if(sswgt_CartManager.mode=='layer'){
this.layer(sswgt_CartManager.params.layer_id,frameWidth,frameHeight);
}}
border(sswgt_CartManager.objMain);
closeButton(objBorder);
};
if(old_onresize){old_onresize();}
};
var old_onkeydown=document.onkeydown;
document.onkeydown=function(event){
event=event?event:window.event;
if(event){
switch(event.keyCode?event.keyCode:event.which?event.which:null){
case 0x1B:sswgt_CartManager.hide(true);
}}
if(old_onkeydown){old_onkeydown();}
};
},
'showLayer':function(layer_id,width,height){
this.mode='layer';
this.params={'layer_id':layer_id};
this._show(width,height);
showSelectBoxes();
},
'show':function(url,width,height){
this.mode='frame';
this.params={'url':url};
this._show(width,height);
},
'resizeFrame':function(width,height){
if(width!=null){this.frameWidth=width;}
if(height!=null){this.frameHeight=height;}
this.frame(null,this.frameWidth,this.frameHeight);
this.border(this.objFrame);
this.closeButton(this.objBorder);
},
'div':function(){
this.objDiv=document.createElement('div');
setStyle(this.objDiv,'zIndex:100; position: absolute; left:0; top: 0;');
var objBody=document.getElementsByTagName("body").item(0);
objBody.appendChild(this.objDiv);
this.objDiv.style.backgroundAttachment='fixed';
},
'layer':function(layer_id,width,height){
var objLayer=getLayer(layer_id);
setStyle(objLayer,'visibility:hidden; display: block');
if(!width){width=objLayer.offsetWidth;}
if(!height){height=objLayer.offsetHeight;}
this.frameWidth=width;
this.frameHeight=height;
var page=getPageSize();
var left=(page[2]-width)/2;
if(left<0){left=0;}
var top=(page[3]-height)/2;
if(top<10){top=10;}
this.objBase.appendChild(objLayer);
setStyle(objLayer,'top:'+top+'px; left:'+left+'px; width:'+width+'px; height:'+height+'px;overflow: auto;zIndex:121; position:absolute;visibility:visible');
this.objBase.style.visibility='visible';
this.objMain=objLayer;
},
'frame':function(url,width,height){
this.frameWidth=width;
this.frameHeight=height;
var page=getPageSize();
var left=(page[2]-width)/2;if(left<0){left=0;}
var top=(page[3]-height)/2;if(top<10){top=10;}
var objFrame=document.getElementById(this.prefix+'frame');
if(!objFrame){
var objT=document.createElement('div');
objT.style.display='none';
objT.innerHTML='<iframe id="'+this.prefix+'frame" frameborder="0"></iframe>';
this.objBase.appendChild(objT);
objFrame=document.getElementById(this.prefix+'frame');
this.objBase.appendChild(objFrame);
this.objBase.removeChild(objT);
setStyle(objFrame,'zIndex:120; position:absolute; backgroundColor:#ffffff');
var objLoading=document.createElement('div');
this.objBase.appendChild(objLoading);
setStyle(objLoading,'backgroundColor:#ffffff; zIndex:121; position:absolute; padding:20px; left:'+(page[2]/2-50+20)+'px; top:'+(page[3]/2-50)+'px;visibility: visible;');
var objImgLoading=document.createElement('img');
objImgLoading.src=((window.CONF_ON_WEBASYST||(this.shop_url.search('webasyst.net')!=-1))?(this.shop_url.replace(/shop\//,'')+'shop/'):(this.shop_url+'published/SC/html/scripts/'))+'images_common/loading.gif';
objLoading.appendChild(objImgLoading);
setTimeout(function(){objFrame.src=url;},100);
var objBase=this.objBase;
function objFrame_onload(){
if(objFrame.style.visibility!='visible'){
var objLoading1=objLoading;
var objBase1=objBase;
setTimeout(function(){
if(objLoading1&&objLoading1.parentNode){
objLoading1.parentNode.removeChild(objLoading1);
objLoading1=null;
}
objBase1.style.visibility='visible';},800);
}
};
if(objFrame.addEventListener)objFrame.addEventListener("load",objFrame_onload,false);
else if(objFrame.attachEvent)objFrame.attachEvent("onload",objFrame_onload);
this.objFrame=objFrame;
this.objMain=this.objFrame;
}
setStyle(objFrame,'top:'+top+'px; left:'+left+'px; width:'+width+'px; height:'+height+'px');
},
'base':function(){
if(!/MSIE/.test(navigator.userAgent)){
var objBase=document.createElement("div");
objBase.style.visibility='hidden';
}else{
this.objDiv.innerHTML+='<div'+' id="myBase" style=\'z-index:95; position:absolute; visibility:hidden; top: expression(parseInt(document.documentElement.scrollTop || document.body.scrollTop, 10)+"px"); left: expression(parseInt(document.documentElement.scrollLeft || document.body.scrollLeft, 10)+"px");\'></div>';
var objBase=document.getElementById('myBase');
}
setStyle(objBase,'zIndex:95');
if(!/MSIE/.test(navigator.userAgent)){setStyle(objBase,'top:0; left:0; position: fixed');}
var arrayPageSize=getPageSize();
objBase.style.width=arrayPageSize[2]+'px';
objBase.style.height=arrayPageSize[3]+'px';
objBase.onclick=function(ev){if(getEventObject(ev).target.id&&getEventObject(ev).target.id==this.id){sswgt_CartManager.hide(true);}};
this.objDiv.insertBefore(objBase,this.objDiv.firstChild);
this.objBase=objBase;
this.overlay();
},
'overlay':function(){
var objOverlay=document.getElementById(this.prefix+'overlay');
if(!objOverlay){
objOverlay=document.createElement('div');
objOverlay.id=this.prefix+'overlay';
this.objBase.appendChild(objOverlay);
}
var left=0;
var top=0;
var width=this.objBase.offsetWidth;
var height=this.objBase.offsetHeight;
setStyle(objOverlay,'position:absolute; visibility: visible; top:'+top+'; left:'+left+'; width:'+width+'px; height:'+height+'px; backgroundColor:#000000');
setOpacity(objOverlay,0.7);
objOverlay.onclick=function(ev){if(getEventObject(ev).target.id&&getEventObject(ev).target.id==this.id){sswgt_CartManager.hide(true);}};
this.objOverlay=objOverlay;
},
'hide':function(remove){
if(this.objDiv&&this.objDiv.parentNode){
if(this.objOverlay){
this.objDiv.appendChild(this.objOverlay);
}
this.objDiv.style.display="none";
if(remove){
if(this.mode=='layer'){
setStyle(this.objMain,'display:none');
setStyle(this.objMain,'visibility:hidden');
document.body.appendChild(this.objMain);
}
this.objDiv.parentNode.removeChild(this.objDiv);
this.objDiv=null;
this.objOverlay=null;
}
showSelectBoxes();
showFlash();
}
},
'closeButton':function(parentObject){
with(this){
var objCloseButton=document.getElementById(prefix+'closeButton');
if(!objCloseButton){
objCloseButton=document.createElement('img');
objCloseButton.id=prefix+'closeButton';
}
var left=parentObject.offsetLeft+parentObject.offsetWidth-22;
var top=parentObject.offsetTop-25;
setStyle(objCloseButton,'position:absolute; top:'+top+'; left:'+left+'; cursor:pointer; cursor:hand');
objCloseButton.src=((window.CONF_ON_WEBASYST||(this.shop_url.search('webasyst.net')!=-1))?(this.shop_url.replace(/shop\//,'')+'shop/'):(this.shop_url+'published/SC/html/scripts/'))+'images_common/close.gif';
objCloseButton.onclick=function(){sswgt_CartManager.hide(true);return false;};
objBase.appendChild(objCloseButton);
};
},
'border':function(parentObj){
var objBorder=document.getElementById(this.prefix+'border');
if(!objBorder){
objBorder=document.createElement('div');
objBorder.id=this.prefix+'border';
this.objBase.appendChild(objBorder);
}
var border_width=0;
var left=parseInt(parentObj.style.left,10)-border_width;
var top=parseInt(parentObj.style.top,10)-border_width;
var width=parentObj.offsetWidth;
var height=parentObj.offsetHeight;
if(/MSIE/.test(navigator.userAgent)){
width+=border_width*2;
height+=border_width*2;
}
setStyle(objBorder,'position:absolute; top:'+top+'; left:'+left+'; width:'+width+'px; height:'+height+'px; border: '+border_width+'px solid #efefef');
this.objBorder=objBorder;
}
};
function showSelectBoxes(){
var selects=document.getElementsByTagName("select");
for(i=0;i!=selects.length;i++){
selects[i].style.visibility="visible";
}
}
function hideSelectBoxes(){
var selects=document.getElementsByTagName("select");
for(i=0;i!=selects.length;i++){
selects[i].style.visibility="hidden";
}
}
function showFlash(){
var flashObjects=document.getElementsByTagName("object");
for(i=0;i<flashObjects.length;i++){
flashObjects[i].style.visibility="visible";
}
var flashEmbeds=document.getElementsByTagName("embed");
for(i=0;i<flashEmbeds.length;i++){
flashEmbeds[i].style.visibility="visible";
}
}
function hideFlash(){
var flashObjects=document.getElementsByTagName("object");
for(i=0;i<flashObjects.length;i++){
flashObjects[i].style.visibility="hidden";
}
var flashEmbeds=document.getElementsByTagName("embed");
for(i=0;i<flashEmbeds.length;i++){
flashEmbeds[i].style.visibility="hidden";
}
}
function getPageSize(){
var xScroll,yScroll;
if(window.innerHeight&&window.scrollMaxY){
xScroll=window.innerWidth+window.scrollMaxX;
yScroll=window.innerHeight+window.scrollMaxY;
}else if(document.body.scrollHeight>document.body.offsetHeight){
xScroll=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
xScroll=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
var windowWidth,windowHeight;
if(self.innerHeight){
if(document.documentElement.clientWidth){
windowWidth=document.documentElement.clientWidth;
}else{
windowWidth=self.innerWidth;
}
windowHeight=self.innerHeight;
}else if(document.documentElement&&document.documentElement.clientHeight){
windowWidth=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else if(document.body){
windowWidth=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
if(yScroll<windowHeight){
pageHeight=windowHeight;
}else{
pageHeight=yScroll;
}
if(xScroll<windowWidth){
pageWidth=xScroll;
}else{
pageWidth=windowWidth;
}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
}
function setOpacity(element,value){
if(value==1){
element.style.opacity=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:null;
if(/MSIE/.test(navigator.userAgent)){
element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'');
}
}else{
if(value<0.00001){value=0;}
element.style.opacity=value;
if(/MSIE/.test(navigator.userAgent)){
element.style.filter=element.style.filter.replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+value*100+')';
}
}
}
function setStyle(obj,style_str){
var styles=style_str.split(";");
with(obj){
for(var k=styles.length-1;k>=0;k--){
var _style=styles[k].split(':',2);
if(!_style[1]){continue;}
_style[0]=_style[0].replace(/^\s|\s$/,'');
_style[1]=_style[1].replace(/^\s|\s$/,'');
style[_style[0]]=_style[1];
}
};
}
function getEventObject(ev){
var my_ev={};
ev=ev?ev:window.event;
if(ev.srcElement){
my_ev.target=ev.srcElement;
}else{
my_ev.target=ev.target;
}
my_ev.ev=ev;
return my_ev;
}
}
function open_printable_version(link)
{
var win="menubar=no,location=no,resizable=yes,scrollbars=yes";
newWin=window.open(link,'printableWin',win);
if(newWin){newWin.focus();}
}
function confirmUnsubscribe()
{
temp=window.confirm(translate.cnfrm_unsubscribe);
if(temp)
{
window.location="index.php?killuser=yes";
}
}
function validate()
{
if(document.subscription_form.email.value.length<1){
alert(translate.err_input_email);
return false;
}
if(document.subscription_form.email.value=='Email'){
alert(translate.err_input_email);
return false;
}
return true;
}
function validate_disc()
{
if(document.formD.nick.value.length<1){
alert(translate.err_input_nickname);
return false;
}
if(document.formD.topic.value.length<1){
alert(translate.err_input_message_subject);
return false;
}
return true;
}
function validate_search(){
if(document.Sform.price1.value!=""
&&((document.Sform.price1.value<0)||isNaN(document.Sform.price1.value))){
alert(translate.err_input_price);
return false;
}
if(document.Sform.price2.value!=""
&&((document.Sform.price2.value<0)||isNaN(document.Sform.price2.value))){
alert(translate.err_input_price);
return false;
}
return true;
}
function validate_input_digit(e){
var keynum;
var keychar;
var numcheck;
try{
if(window.event)
{
keynum=window.event.keyCode;
}else if(e.which)
{
keynum=e.which;
}
}catch(exception){
alert(exception.message);
}
keynum=parseInt(keynum);
if(keynum==13)
return false;
if(keynum>=33&&keynum<=40)
return true;
if(keynum==8)
return true;
if(keynum==17)
return true;
if(keynum==45)
return true;
if(keynum==46)
return true;
if(keynum>=96&&keynum<=105){
keynum-=48;
}
keychar=String.fromCharCode(keynum);
numcheck=/\d/;
return numcheck.test(keychar);
var res=numcheck.test(keychar);
return res;
}
Behaviour.register({
'input.input_message':function(e){
e.onfocus=function(){
this.className=this.className.replace(/input_message/,'')
+' input_message_focus';
if(this.value!=this.getAttribute('rel'))
return;
this.value='';
}
e.onblur=function(){
if(this.value!='')
return;
this.className=this.className.replace(/input_message_focus/,'')
+' input_message';
this.value=this.getAttribute('rel');
}
},
'.add2cart_handler':function(element){
element.onclick=function(){
var objForm=getFormByElem(this);
if(!objForm)
return true;
var r_productParam=getElementsByClass('product_option',objForm);
var query='';
for(var i=r_productParam.length-1;i>=0;i--){
if(!parseInt(r_productParam[i].value))
continue;
if(r_productParam[i].name)
query+='&'+r_productParam[i].name+'='
+parseInt(r_productParam[i].value);
}
var r_productQty=getElementByClass('product_qty',objForm);
if(r_productQty){
r_productQty=parseInt(r_productQty.value);
if(r_productQty>1){
query+='&product_qty='+r_productQty;
}
}
var url=ORIG_LANG_URL
+set_query('?ukey=cart&view=noframe&action=add_product&'
+query+'&productID='
+objForm.getAttribute('rel'),'');
openFadeIFrame(url);
return false;
}
},
'.product_option':function(e){
e.onchange=function(){
var objForm=getFormByElem(this);
if(!objForm)
return true;
var r_productParam=getElementsByClass('product_option',objForm);
var price=parseFloat(getElementByClass('product_price',objForm).value);
var list_price=0;
var obj=getElementByClass('product_list_price',objForm);
if(obj)
list_price=parseFloat(obj.value);
for(var i=r_productParam.length-1;i>=0;i--){
var option=select_getCurrOption(r_productParam[i]);
if(!option)
continue;
price+=parseFloat(option.getAttribute('rel'));
list_price+=parseFloat(option.getAttribute('rel'));
}
getElementByClass('totalPrice',objForm).innerHTML=formatPrice(price);
var obj=getElementByClass('regularPrice',objForm);
if(obj)
obj.innerHTML=formatPrice(list_price);
var obj=getElementByClass('youSavePrice',objForm);
if(obj)
obj.innerHTML=formatPrice(list_price-price)
+' ('
+Math
.round((list_price-price)/list_price*100,
2)+'%)';
}
},
'.hndl_proceed_checkout':function(e){
e.onclick=function(){
openFadeIFrame(ORIG_LANG_URL+set_query('?ukey=cart&view=noframe'));
return false;
}
},
'input.goto':function(e){
e.onclick=function(){
if(this.className.search(/confirm/)!==-1
&&!window.confirm(this.getAttribute('title')))
return
document.location.href=this.getAttribute('rel');
}
},
'.gofromfade':function(e){
e.onclick=function(){
parent.document.location.href=this.href;
parent.closeFadeIFrame();
return false;
}
},
'input.digit':function(e){
e.onkeydown=function(event){
return validate_input_digit(event);
}
}
});
Behaviour.addLoadEvent(function(){
var totalPrices=getElementsByClass('totalPrice');
for(var k=totalPrices.length-1;k>=0;k--){
var objForm=getFormByElem(totalPrices[k]);
if(!objForm)
continue;;
var r_productParam=getElementsByClass('product_option',objForm);
var price=parseFloat(getElementByClass('product_price',objForm).value);
var list_price=0;
var obj=getElementByClass('product_list_price',objForm);
if(obj)
list_price=parseFloat(obj.value);
for(var i=r_productParam.length-1;i>=0;i--){
var option=select_getCurrOption(r_productParam[i]);
if(!option)
continue;
price+=parseFloat(option.getAttribute('rel'));
list_price+=parseFloat(option.getAttribute('rel'));
}
totalPrices[k].innerHTML=formatPrice(price);
var obj=getElementByClass('regularPrice',objForm);
if(obj)
obj.innerHTML=formatPrice(list_price);
var obj=getElementByClass('youSavePrice',objForm);
if(obj)
obj.innerHTML=formatPrice(list_price-price)+' ('
+Math.round((list_price-price)/list_price*100,2)
+'%)';
}
});

