function appendTextToElement(elementName, text){ document.getElementById(elementName).innerHTML += text; document.getElementById(elementName).style.display = ""; } function checkEmail(str) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if(reg.test(str) == false) { return false; } return true; var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true } function confirmSubmit(text) { var agree=confirm(text); if(agree) return true; else return false ; } function expand(thistag, img, hideText, showText, newSrcUrl) { styleObj=document.getElementById(thistag).style; if (styleObj.display=='none') { styleObj.display=''; //img.innerHTML = hideText; img.src = newSrcUrl+"/collapse.gif"; } else { styleObj.display='none'; //img.innerHTML = showText; img.src = newSrcUrl+"/expand.gif"; } } function iframe(name,url,params,width,height) { // Remove old dialog $('#iframe').dialog('close'); $('#iframe').remove(); // Create iframe var iframe = document.createElement("iframe"); iframe.setAttribute('id',name); var $dialog = $('
').html('') .dialog({ autoOpen: false, modal: true, height: width, width: height, title: '', closeOnEscape: true }); $dialog.dialog('open'); } function iframeWithPost(name,url,params,width,height) { // Remove old dialog if ($('#iframe') != null) { $('#iframe').dialog('close'); $('#iframe').remove(); } // Create iframe var iframe = document.createElement("iframe"); iframe.setAttribute('id',name); iframe.setAttribute('name',name); iframe.setAttribute('frameborder','0'); iframe.setAttribute('width','100%'); iframe.setAttribute('height','100%'); var $dialog = $('
').html(iframe) .dialog({ autoOpen: false, modal: true, height: width, width: height, title: '', closeOnEscape: true, open: function(event, ui) { form = document.createElement("form"); $(form).attr({"action":url,"method":"POST","target":name}); for (var i in params) { if (params.hasOwnProperty(i)) { var input = document.createElement('input'); input.type = 'hidden'; input.name = i; input.value = params[i]; form.appendChild(input); } } $('#iframe').append(form); $(form).submit() } }); $dialog.dialog('open'); //$(form).submit(); } function imagePreview(picture,value) { if(value!="") picture.src = "file://localhost/" + value; } function imageResizeWidth(img,maxWidth) { if(img.width>maxWidth) img.width=maxWidth; img.height=maxWidth*(img.height/img.width); } function imageResizeHeight(img,maxHeight) { if(img.height>maxHeight) img.height=maxHeight; img.width=maxHeight*(img.width/img.height); } function popup(mypage,myname,w,h,features) { if(screen.width){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; } else { winl = 0; wint =0; } if(winl<0) winl = 0; if(wint<0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; win = window.open(mypage,myname,settings); win.window.focus(); if(!win.opener) win.opener = self; } function popupWithPost(mypage,myname,w,h,features,params) { if(screen.width){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; } else { winl = 0; wint =0; } if(winl<0) winl = 0; if(wint<0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; //note I am using a post.htm page since I did not want to make double request to the page //it might have some Page_Load call which might screw things up. //window.open("post.htm", name, windowoption); win = window.open("index.htm",myname,settings); win.window.focus(); if(!win.opener) win.opener = self; var form = document.createElement("form"); form.setAttribute("method", "post"); form.setAttribute("action", mypage); form.setAttribute("target", myname); for (var i in params) { if (params.hasOwnProperty(i)) { var input = document.createElement('input'); input.type = 'hidden'; input.name = i; input.value = params[i]; form.appendChild(input); } } document.body.appendChild(form); form.submit(); document.body.removeChild(form); } function protectMail(name, domain) { window.location = 'mailto:' + name + '@' + domain; } function replaceText(thistag, img, hideText, showText, newSrcUrl) { object=document.getElementById(thistag); object.innerHTML = hideText; } function selectAll(form, checkAllBox, select) { for(var i=0;i ratio_orig) { imageWidth = imageHeight*ratio_orig; } else { imageHeight = imageHeight/ratio_orig; } } else if (ratio_orig==1) { // square if (cropWidth/cropHeight > ratio_orig) { imageWidth = imageHeight/ratio_orig; } else { imageHeight = imageWidth*ratio_orig; } } else { // landscape if (cropWidth/cropHeight > ratio_orig) { imageHeight = imageWidth/ratio_orig; } else { imageWidth = imageHeight*ratio_orig; } } preview.style.width = imageWidth+"px"; preview.style.height = imageHeight+"px"; preview.style.marginLeft = imageWidth > cropWidth ? "-" + ((imageWidth-cropWidth) / 2) + "px" : "0px"; preview.style.marginTop = imageHeight > cropHeight ? "-" + ((imageHeight-cropHeight) / 2) + "px" : "0px"; } preview.src = e.target.result; } img.src = e.target.result; } reader.readAsDataURL(file); } } }/* SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License */ var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("