var currDiv;
var divCount=1;
var fadeTimer;
var appearTimer;
var changeTimer;
function setOpacity(_1,_2){
if(_1.style.opacity||_1.style.opacity==""){
_1.style.opacity=_2;
}else{
op=parseInt(100*_2,10);
_1.style.filter="alpha(opacity="+op+")";
}
}
function appear(_3){
var _4=0;
appearTimer=setInterval(makeAppear,150);
function makeAppear(){
if(_4>=1){
setOpacity(_3,"1");
clearInterval(appearTimer);
}else{
_4+=0.1;
setOpacity(_3,_4);
}
}
}
function fade(_5,_6){
fadeTimer=setInterval(makeFade,130);
function makeFade(){
if(_6<=0){
setOpacity(_5,"0");
clearInterval(fadeTimer);
}else{
_6-=0.1;
setOpacity(_5,_6);
}
}
}
function changeItem(x,_8){
var _9=document.getElementById("d"+currDiv);
var _a=parseInt(x);
fade(_9,_8);
currDiv+=_a;
if(currDiv>divCount){
currDiv=1;
}else{
if(currDiv<1){
currDiv=divCount;
}
}
appear(document.getElementById("d"+currDiv));
}
function callChangeItem(){
changeItem(1,1);
}
function nextItem(x){
var _c;
clearInterval(fadeTimer);
clearInterval(appearTimer);
clearInterval(changeTimer);
for(var i=1;i<=divCount;i++){
_c=document.getElementById("d"+i);
setOpacity(_c,"0");
}
i=parseInt(x);
changeItem(i,0);
if(divCount>1){
changeTimer=setInterval(callChangeItem,10000);
}else{
if(divCount===1){
_c=document.getElementById("d1");
setOpacity(_c,"1");
}
}
document.oncontextmenu=new Function("return false");
}
$(document).ready(function(){
var e;
while(1){
e=document.getElementById("d"+divCount);
if(!e){
break;
}
setOpacity(e,"0");
divCount++;
}
divCount--;
currDiv=divCount;
if(divCount>1){
changeTimer=setInterval(callChangeItem,10000);
changeItem(1,1);
}else{
if(divCount==1){
setOpacity(document.getElementById("d1"),"1");
}
}
});
var help_table;
function print_preview(){
var _f=get_active_tab();
var _10=_f.element_.html();
$("#printHTML").val(_10);
$("#printForm").get(0).submit();
}
function make_drop_down(_11,_12,top,_14){
var t=document.createElement("TABLE");
var _16=document.createElement("TBODY");
t.appendChild(_16);
for(var i=0;i<_11.length;++i){
var tr=document.createElement("TR");
var td=document.createElement("TD");
$(td).text(_11[i]);
$(td).css({padding:"5px 10px",cursor:"hand"});
$(td).css({cursor:"pointer"});
$(td).css({fontSize:"12px"});
tr.appendChild(td);
_16.appendChild(tr);
(function(_1a){
$(td).click(function(e){
_12(_1a);
t.parentNode.removeChild(t);
});
})(i);
$(td).mouseover(function(e){
$(this).css({"background":"#DCEBFD"});
});
$(td).mouseout(function(e){
$(this).css({"background":"#fafbfb"});
});
}
$(t).css({position:"absolute",border:"1px solid #DDE9F9",background:"#fafbfb",top:top,left:_14});
document.body.appendChild(t);
return t;
}
function select_help(i){
help_table=null;
var _1f=$("#helpspan").attr("src");
var _20=_1f.replace(/icons([a-zA-Z\-]*)/,"icons");
$("#helpspan").attr("src",_20);
if(i==0){
var _21=getLANG().toLowerCase();
window.location.href="./"+_21+"/demo-editor.html";
}
if(i==1){
var _21=getLANG().toLowerCase();
var url="./"+_21+"/help.html";
window.open(url);
}
}
function show_help(){
var p=$("#helpspan").position();
if(help_table&&help_table.style.display!="none"){
help_table.parentNode.removeChild(help_table);
var _24=$("#helpspan").attr("src");
var _25=_24.replace(/icons([a-zA-Z\-]*)/,"icons");
$("#helpspan").attr("src",_25);
help_table=null;
}else{
help_table=make_drop_down(["Interactive Demo","Correcting Words"],select_help,p.top+25,p.left-90);
$(help_table).attr("id","help_table");
show_popup("#help_table",function(){
if(help_table){
var _26=$("#helpspan").attr("src");
var _27=_26.replace(/icons([a-zA-Z\-]*)/,"icons");
$("#helpspan").attr("src",_27);
$(help_table).remove();
help_table=null;
}
});
var _28=$("#helpspan").attr("src");
var _29=_28.replace(/icons([a-zA-Z\-]*)/,"icons-pushed");
$("#helpspan").attr("src",_29);
}
}
function setCookie(key,_2b,p){
var t=new Date();
var _2e=new Date(t.getFullYear()+1,t.getMonth(),t.getDate());
if(!p){
document.cookie=key+"="+escape(_2b)+";expires="+_2e.toGMTString()+"; path=/";
}else{
document.cookie=key+"="+escape(_2b)+";expires="+_2e.toGMTString()+"; path="+p.toLowerCase();
}
}
function readCookie(key){
var _30=document.cookie;
var _31=_30.indexOf(key+"=");
if(_31>=0){
var str=_30.substring(_31,_30.length);
var _33=str.indexOf(";");
if(_33<0){
_33=str.length;
}
str=str.substring(0,_33).split("=");
return unescape(str[1]);
}else{
return null;
}
}
function eraseCookie(key){
var _35=new Date(1970);
document.cookie=key+"= ; expires="+_35.toGMTString()+"; path=/";
}
function changeCookie(){
eraseCookie();
if(navigator.cookieEnabled){
setCookie("lang",__lang__);
}
}
function getCurrentLangCookieValue(){
var _36="Hindi";
if(navigator.cookieEnabled){
lang=readCookie("lang");
if(lang!=null){
return lang;
}
}
return "Hindi";
}
function continue_demo(){
window.location.href="../"+$("#demo_langlist").val().toLowerCase()+"/demo-editor2.html";
}
function replay_animation(){
var _37=document.getElementById("animation");
if(_37&&!_37.IsPlaying()){
_37.Play();
}
window.setTimeout("replay_animation()",1000);
}
var timeout=500;
var closetimer=0;
var ddmenuitem=0;
function jsddm_open(){
jsddm_canceltimer();
jsddm_close();
ddmenuitem=$(this).find("ul").css("visibility","visible");
}
function jsddm_close(){
if(ddmenuitem){
ddmenuitem.css("visibility","hidden");
}
}
function jsddm_timer(){
closetimer=window.setTimeout(jsddm_close,timeout);
}
function jsddm_canceltimer(){
if(closetimer){
window.clearTimeout(closetimer);
closetimer=null;
}
}
$(document).ready(function(){
$("#jsddm > li").bind("mouseover",jsddm_open);
$("#jsddm > li").bind("mouseout",jsddm_timer);
$("#jsddm > li").bind("click",jsddm_open);
});
function MM_preloadImages(){
var d=document;
if(d.images){
if(!d.MM_p){
d.MM_p=new Array();
}
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;i<a.length;i++){
if(a[i].indexOf("#")!=0){
d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];
}
}
}
}
function MM_findObj(n,d){
if(!n){
return;
}
var p,i,x;
if(!d){
d=document;
}
if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all){
x=d.all[n];
}
for(i=0;!x&&i<d.forms.length;i++){
x=d.forms[i][n];
}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){
x=MM_findObj(n,d.layers[i].document);
}
if(!x&&d.getElementById){
x=d.getElementById(n);
}
return x;
}
function MM_swapImgRestore(){
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++){
if(x.src.indexOf("icons-pushed")<0){
x.src=x.oSrc;
}
}
}
function MM_swapImage(){
var i,j=0,x,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3){
if((x=MM_findObj(a[i]))!=null){
document.MM_sr[j++]=x;
if(!x.oSrc){
x.oSrc=x.src;
}
x.src=a[i+2];
}
}
}
$(document).ready(function(){
$("#langDiv").hide();
$("#langSelectButton").click(function(){
var pos=$("#langSelectButton").position();
$("#langDiv").css({position:"absolute",marginLeft:0,marginTop:0,top:pos.bottom,left:pos.left});
$("#langDiv").show();
});
$("#supported-langs img").mouseover(function(){
$(this).addClass("supported-lang-active");
});
$("#supported-langs img").mouseout(function(){
$(this).removeClass("supported-lang-active");
});
$("#jsddm .ddLang").click(function(e){
var _4a=$(this).text();
$("#chosenLang").text(_4a);
});
$("#view-all>a").click(function(e){
$("#all-langs").fadeIn(1000);
$("#top-three-langs").hide();
$("#view-all").hide();
$("#view-top").show();
});
$("#view-top>a").click(function(){
$("#all-langs").fadeOut(1000);
$("#top-three-langs").show();
$("#view-top").hide();
$("#view-all").show();
});
if($.browser.safari){
$("#mobile_banner").css({"padding-bottom":"5px"});
}
setLANG(__lang__);
});
var CookieManager={set:function(_4c,_4d){
var _4e=new Date();
_4e.setTime(_4e.getTime()+(30*24*60*60*1000));
var _4f="; expires="+_4e.toGMTString();
document.cookie=_4c+"="+escape(_4d)+_4f+"; path=/";
},get:function(_50){
var dc=document.cookie;
var _52=_50+"=";
var _53=dc.indexOf("; "+_52);
if(_53==-1){
_53=dc.indexOf(_52);
if(_53!==0){
return null;
}
}else{
_53+=2;
}
var end=document.cookie.indexOf(";",_53);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_53+_52.length,end));
},erase:function(_55){
var _56=new Date(2000,1,1,19,30,30);
document.cookie=_55+"=; expires="+_56.toGMTString();
}};
CookieManager.setCookiePair=function(_57,key,_59){
var _5a,end;
var _5c=CookieManager.get(_57);
var _5d=[key,"@",_59,"#"].join("");
function trimEntry(s){
var a=s.split(",");
return a.slice(3).join(",");
}
if(!_5c){
CookieManager.set(_57,_5d);
}else{
_5a=_5c.search(eval("/(^|#)"+key+"@/"));
if(_5a===-1){
_5c+=_5d;
}else{
if(_5c.charAt(_5a)==="#"){
_5a+=1;
}
end=_5c.indexOf("#",_5a);
_5c=_5c.replace(_5c.substring(_5a,end+1),_5d);
}
while(_5c.length>600){
_5c=trimEntry(_5c);
}
CookieManager.set(_57,_5c);
}
};
CookieManager.getCookiePair=function(_60,key){
var _62=CookieManager.get(_60);
if(!_62){
return null;
}
var _63=_62.search(eval("/(^|#)"+key+"@/"));
if(_63===-1){
return null;
}
var end=_62.indexOf("#",_63+1);
var s=_62.substring(_63,end);
return s.split("@")[1];
};
if(!this.JSON){
JSON={};
}
(function(){
function f(n){
return n<10?"0"+n:n;
}
if(typeof Date.prototype.toJSON!=="function"){
Date.prototype.toJSON=function(key){
return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z";
};
String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){
return this.valueOf();
};
}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_6a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,_6c,_6d={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},rep;
function quote(_6f){
_6a.lastIndex=0;
return _6a.test(_6f)?"\""+_6f.replace(_6a,function(a){
var c=_6d[a];
return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
})+"\"":"\""+_6f+"\"";
}
function str(key,_73){
var i,k,v,_77,_78=gap,_79,_7a=_73[key];
if(_7a&&typeof _7a==="object"&&typeof _7a.toJSON==="function"){
_7a=_7a.toJSON(key);
}
if(typeof rep==="function"){
_7a=rep.call(_73,key,_7a);
}
switch(typeof _7a){
case "string":
return quote(_7a);
case "number":
return isFinite(_7a)?String(_7a):"null";
case "boolean":
case "null":
return String(_7a);
case "object":
if(!_7a){
return "null";
}
gap+=_6c;
_79=[];
if(Object.prototype.toString.apply(_7a)==="[object Array]"){
_77=_7a.length;
for(i=0;i<_77;i+=1){
_79[i]=str(i,_7a)||"null";
}
v=_79.length===0?"[]":gap?"[\n"+gap+_79.join(",\n"+gap)+"\n"+_78+"]":"["+_79.join(",")+"]";
gap=_78;
return v;
}
if(rep&&typeof rep==="object"){
_77=rep.length;
for(i=0;i<_77;i+=1){
k=rep[i];
if(typeof k==="string"){
v=str(k,_7a);
if(v){
_79.push(quote(k)+(gap?": ":":")+v);
}
}
}
}else{
for(k in _7a){
if(Object.hasOwnProperty.call(_7a,k)){
v=str(k,_7a);
if(v){
_79.push(quote(k)+(gap?": ":":")+v);
}
}
}
}
v=_79.length===0?"{}":gap?"{\n"+gap+_79.join(",\n"+gap)+"\n"+_78+"}":"{"+_79.join(",")+"}";
gap=_78;
return v;
}
}
if(typeof JSON.stringify!=="function"){
JSON.stringify=function(_7b,_7c,_7d){
var i;
gap="";
_6c="";
if(typeof _7d==="number"){
for(i=0;i<_7d;i+=1){
_6c+=" ";
}
}else{
if(typeof _7d==="string"){
_6c=_7d;
}
}
rep=_7c;
if(_7c&&typeof _7c!=="function"&&(typeof _7c!=="object"||typeof _7c.length!=="number")){
throw new Error("JSON.stringify");
}
return str("",{"":_7b});
};
}
if(typeof JSON.parse!=="function"){
JSON.parse=function(_7f,_80){
var j;
function walk(_82,key){
var k,v,_86=_82[key];
if(_86&&typeof _86==="object"){
for(k in _86){
if(Object.hasOwnProperty.call(_86,k)){
v=walk(_86,k);
if(v!==undefined){
_86[k]=v;
}else{
delete _86[k];
}
}
}
}
return _80.call(_82,key,_86);
}
cx.lastIndex=0;
if(cx.test(_7f)){
_7f=_7f.replace(cx,function(a){
return "\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
});
}
if(/^[\],:{}\s]*$/.test(_7f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){
j=eval("("+_7f+")");
return typeof _80==="function"?walk({"":j},""):j;
}
throw new SyntaxError("JSON.parse");
};
}
})();
var tb_pathToImage="http://quillpad.in/images/loadingAnimation.gif";
$(document).ready(function(){
tb_init("a.thickbox, area.thickbox, input.thickbox");
imgLoader=new Image();
imgLoader.src=tb_pathToImage;
});
function tb_init(_88){
$(_88).click(function(){
var t=this.title||this.name||null;
var a=this.href||this.alt;
var g=this.rel||false;
tb_show(t,a,g);
this.blur();
return false;
});
}
function tb_show(_8c,url,_8e){
try{
if(typeof document.body.style.maxHeight==="undefined"){
$("body","html").css({height:"100%",width:"100%"});
$("html").css("overflow","hidden");
if(document.getElementById("TB_HideSelect")===null){
$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
}else{
if(document.getElementById("TB_overlay")===null){
$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
}
if(tb_detectMacXFF()){
$("#TB_overlay").addClass("TB_overlayMacFFBGHack");
}else{
$("#TB_overlay").addClass("TB_overlayBG");
}
if(_8c===null){
_8c="";
}
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
$("#TB_load").show();
var _8f;
if(url.indexOf("?")!==-1){
_8f=url.substr(0,url.indexOf("?"));
}else{
_8f=url;
}
var _90=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
var _91=_8f.toLowerCase().match(_90);
if(_91==".jpg"||_91==".jpeg"||_91==".png"||_91==".gif"||_91==".bmp"){
TB_PrevCaption="";
TB_PrevURL="";
TB_PrevHTML="";
TB_NextCaption="";
TB_NextURL="";
TB_NextHTML="";
TB_imageCount="";
TB_FoundURL=false;
if(_8e){
TB_TempArray=$("a[@rel="+_8e+"]").get();
for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){
var _92=TB_TempArray[TB_Counter].href.toLowerCase().match(_90);
if(!(TB_TempArray[TB_Counter].href==url)){
if(TB_FoundURL){
TB_NextCaption=TB_TempArray[TB_Counter].title;
TB_NextURL=TB_TempArray[TB_Counter].href;
TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
}else{
TB_PrevCaption=TB_TempArray[TB_Counter].title;
TB_PrevURL=TB_TempArray[TB_Counter].href;
TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
}
}else{
TB_FoundURL=true;
TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);
}
}
}
imgPreloader=new Image();
imgPreloader.onload=function(){
imgPreloader.onload=null;
var _93=tb_getPageSize();
var x=_93[0]-150;
var y=_93[1]-150;
var _96=imgPreloader.width;
var _97=imgPreloader.height;
if(_96>x){
_97=_97*(x/_96);
_96=x;
if(_97>y){
_96=_96*(y/_97);
_97=y;
}
}else{
if(_97>y){
_96=_96*(y/_97);
_97=y;
if(_96>x){
_97=_97*(x/_96);
_96=x;
}
}
}
TB_WIDTH=_96+30;
TB_HEIGHT=_97+60;
$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+_96+"' height='"+_97+"' alt='"+_8c+"'/></a>"+"<div id='TB_caption'>"+_8c+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Close</a></div>");
$("#TB_closeWindowButton").click(tb_remove);
if(!(TB_PrevHTML==="")){
function goPrev(){
if($(document).unbind("click",goPrev)){
$(document).unbind("click",goPrev);
}
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_PrevCaption,TB_PrevURL,_8e);
return false;
}
$("#TB_prev").click(goPrev);
}
if(!(TB_NextHTML==="")){
function goNext(){
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_NextCaption,TB_NextURL,_8e);
return false;
}
$("#TB_next").click(goNext);
}
document.onkeydown=function(e){
if(e==null){
keycode=event.keyCode;
}else{
keycode=e.which;
}
if(keycode==27){
tb_remove();
}else{
if(keycode==190){
if(!(TB_NextHTML=="")){
document.onkeydown="";
goNext();
}
}else{
if(keycode==188){
if(!(TB_PrevHTML=="")){
document.onkeydown="";
goPrev();
}
}
}
}
};
tb_position();
$("#TB_load").remove();
$("#TB_ImageOff").click(tb_remove);
$("#TB_window").css({display:"block"});
};
imgPreloader.src=url;
}else{
var _99=url.replace(/^[^\?]+\??/,"");
var _9a=tb_parseQuery(_99);
TB_WIDTH=(_9a["width"]*1)+30||630;
TB_HEIGHT=(_9a["height"]*1)+40||440;
ajaxContentW=TB_WIDTH-30;
ajaxContentH=TB_HEIGHT-45;
if(url.indexOf("TB_iframe")!=-1){
urlNoQuery=url.split("TB_");
$("#TB_iframeContent").remove();
if(_9a["modal"]!="true"){
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+_8c+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Close</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+30)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>");
}else{
$("#TB_overlay").unbind();
$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+30)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>");
}
}else{
if($("#TB_window").css("display")!="block"){
if(_9a["modal"]!="true"){
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+_8c+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Close</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
}else{
$("#TB_overlay").unbind();
$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
}
}else{
$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";
$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";
$("#TB_ajaxContent")[0].scrollTop=0;
$("#TB_ajaxWindowTitle").html(_8c);
}
}
$("#TB_closeWindowButton").click(tb_remove);
if(url.indexOf("TB_inline")!=-1){
$("#TB_ajaxContent").append($("#"+_9a["inlineId"]).children());
$("#TB_window").unload(function(){
$("#"+_9a["inlineId"]).append($("#TB_ajaxContent").children());
});
tb_position();
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}else{
if(url.indexOf("TB_iframe")!=-1){
tb_position();
if($.browser.safari){
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}
}else{
$("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){
tb_position();
$("#TB_load").remove();
tb_init("#TB_ajaxContent a.thickbox");
$("#TB_window").css({display:"block"});
});
}
}
}
if(!_9a["modal"]){
document.onkeyup=function(e){
if(e==null){
keycode=event.keyCode;
}else{
keycode=e.which;
}
if(keycode==27){
tb_remove();
}
};
}
}
catch(e){
}
}
function tb_showIframe(){
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}
function tb_remove(){
$("#TB_imageOff").unbind("click");
$("#TB_closeWindowButton").unbind("click");
$("#TB_window").fadeOut("fast",function(){
$("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove();
});
$("#TB_load").remove();
if(typeof document.body.style.maxHeight=="undefined"){
$("body","html").css({height:"auto",width:"auto"});
$("html").css("overflow","");
}
document.onkeydown="";
document.onkeyup="";
return false;
}
function tb_position(){
$("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"});
if(!(jQuery.browser.msie&&jQuery.browser.version<7)){
$("#TB_window").css({marginTop:"-"+parseInt((TB_HEIGHT/2),10)+"px"});
}
}
function tb_parseQuery(_9c){
var _9d={};
if(!_9c){
return _9d;
}
var _9e=_9c.split(/[;&]/);
for(var i=0;i<_9e.length;i++){
var _a0=_9e[i].split("=");
if(!_a0||_a0.length!=2){
continue;
}
var key=unescape(_a0[0]);
var val=unescape(_a0[1]);
val=val.replace(/\+/g," ");
_9d[key]=val;
}
return _9d;
}
function tb_getPageSize(){
var de=document.documentElement;
var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;
var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;
arrayPageSize=[w,h];
return arrayPageSize;
}
function tb_detectMacXFF(){
var _a6=navigator.userAgent.toLowerCase();
if(_a6.indexOf("mac")!=-1&&_a6.indexOf("firefox")!=-1){
return true;
}
}
if(typeof (thickbox_connect)=="undefined"){
thickbox_connect={};
thickbox_connect.login=[];
}
thickbox_connect.register=function(_a7){
};
thickbox_connect.login.push(function(_a8){
set_logged_in(_a8);
});
function capitalize(_a9){
var n1=_a9.replace(/"/ig,"");
var _ab=n1.substring(0,1).toUpperCase()+n1.substring(1,n1.length).toLowerCase();
return _ab;
}
function set_logged_in(_ac){
if(typeof (logged_in)!=="undefined"){
logged_in();
}
if(CookieManager.get("QuillAPI_userinfo")){
if(typeof (auth_signin_callbacks)!=="undefined"){
for(var i=0;i<auth_signin_callbacks.length;i++){
auth_signin_callbacks[i](_ac);
}
}
$("#signout_link").show();
$("#user_name").text(capitalize(CookieManager.get("QuillAPI_user")));
$("#tb_user_before_sign_in").hide();
$("#tb_user_after_sign_in").show();
hide_error();
}else{
if(typeof (auth_signout_callbacks)!=="undefined"){
for(var i=0;i<auth_signout_callbacks.length;i++){
auth_signout_callbacks[i](_ac);
}
}
$("#email").val("");
$("#password").val("");
$("#signout_link").hide();
$("#user_name").text("");
$("#tb_user_before_sign_in").show();
$("#tb_user_after_sign_in").hide();
}
}
function delayed_response(){
show_error("Server is taking too long to respond","red");
}
function validate_login(){
clear();
var _ae=$("#email").val();
var _af=$("#password").val();
var _b0=0;
if(!_af){
show_error("Password: Requried field","red");
_b0++;
}
if(!_ae){
show_error("Email Address: Required Field","red");
_b0++;
}else{
if(!isValidEmailID(_ae)){
show_error("Invalid e-mail Address","red");
_b0++;
}
}
if(_b0==0){
login();
}
}
function clear(){
$("#name_err").css({"display":"none"});
$("#email_null_err").css({"display":"none"});
$("#email_invalid_err").css({"display":"none"});
$("#passwd_null_err").css({"display":"none"});
$("#repasswd_null_err").css({"display":"none"});
$("#passwd_mismatch_err").css({"display":"none"});
}
function forgotpasswd(){
clear();
$("#errSpan").html("");
var _b1=140;
var _b2=370;
$("#passwd_row").hide();
var _b3=$("#retype").css("display","none");
var _b4=$("#retype_err_row").css("display","none");
var _b5=$("#btnsubmit").val("Submit");
var _b6=$("#anewuser").css("display","block");
var _b7=$("#name").css("display","none");
var _b7=$("#passwd").css("display","none");
var _b8=$("#name_err_row").css("display","none");
var _b9=$("#aolduser").css("display","none");
$("#TB_window").css({"height":"100px","width":"100px"});
$("#TB_iframeContent").css({"height":"100px"});
}
function isValidEmailID(_ba){
var _bb=_ba.match(/^[0-9a-zA-Z_\.-]+@([0-9a-zA-Z_-]+\.)+[a-zA-Z0-9_-]+$/);
return (_bb!==null);
}
function login(){
show_error("Checking login...Please wait","#006699");
timer=setTimeout("delayed_response()",20000);
$.post("/quillAPI_backend/login",{mailid:$("#email").val(),password:$("#password").val()},function(_bc){
var _bd=JSON.parse(_bc,function(key,_bf){
return _bf;
});
clearTimeout(timer);
if(_bd["status"].indexOf("Error")>=0){
show_error(_bd["messg"],"red");
}else{
show_error(_bd["messg"],"green");
set_logged_in(_bd);
}
});
}
function reset_password(){
$("#errSpan").css({"color":"#006699"});
$("#errSpan").html("Checking Email ID...Please wait");
timer=setTimeout("delayed_response()",20000);
var url=this.parent.location.href;
var _c1=url.split("/");
var ref=_c1[_c1.length-1];
$.post("/emailverifier/forgot_password",{mailid:$("#email").val(),referer:ref},function(_c3){
var _c4=JSON.parse(_c3,function(key,_c6){
return _c6;
});
clearTimeout(timer);
if(_c4["status"].indexOf("Error")>=0){
show_error(_c4["messg"],"red");
}else{
show_error(_c4["messg"],"green");
}
});
}
function sign_out(){
document.cookie="QuillAPI_userinfo=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";
document.cookie="QuillAPI_user=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";
set_logged_in();
}
function show_error(msg,_c8){
var off=$("#email").offset();
var _ca=$("#email").height()+off.top+10;
$("#errSpan").css({"color":_c8});
$("#errSpan").html(msg);
$("#errSpan").css({"top":_ca+"px","left":off.left+"px"});
setTimeout("hide_error()",20000);
}
function hide_error(){
$("#errSpan").css({"top":"-60px","left":"-60px"});
}
var supported_langs={"bengali":true,"gujarati":true,"hindi":true,"kannada":true,"malayalam":true,"marathi":true,"nepali":true,"punjabi":true,"tamil":true,"telugu":true};
function page_is_lang_specific(){
var url=window.location.pathname.split("/");
var len=url.length;
if(supported_langs[url[len-2].toLowerCase()]){
return true;
}
return false;
}
$(document).ready(function(){
set_logged_in();
var _cd=$("<span id=\"errSpan\"></span>");
_cd.css({"position":"absolute","top":"-60px","left":"-60px","width":"300px"});
_cd.css({"font-size":"12px","font-family":"Arial,Helvetica,sans-serif"});
$(document.body).append(_cd);
$("#homelink").click(function(){
var _ce=getLANG().toLowerCase();
if(_ce=="english"){
_ce="hindi";
}
if(page_is_lang_specific()){
window.location="index.html";
}else{
window.location="./"+_ce+"/index.html";
}
return false;
});
$("#demolink").click(function(){
var _cf=getLANG().toLowerCase();
if(_cf=="english"){
_cf="hindi";
}
if(page_is_lang_specific()){
window.location="demo-editor.html";
}else{
window.location="./"+_cf+"/demo-editor.html";
}
return false;
});
});
function setLANG(_d0){
if(CookieManager.get("Language")){
CookieManager.erase("Language");
}
CookieManager.set("Language",_d0);
$(".LANG").each(function(){
$(this).html(_d0);
});
}
function getLANG(){
if(CookieManager.get("Language")){
return CookieManager.get("Language");
}else{
setLANG("Hindi");
return "Hindi";
}
}

