
function category_chk(frm)
{
	var flag_for_category = 0;
	if(frm.expert_type)
	{
	if(frm.expert_type.value!='')
		flag_for_category = 1;
	}
	if(frm.country)
	{
	if(frm.country.value!='')
		flag_for_category = 1;
	}
	if(frm.specialization)
	{
	if(frm.specialization.value!='')
		flag_for_category = 1;
	}
	if(frm.gen_category)
	{
	if(frm.gen_category.value!='')
		flag_for_category = 1;
	}
	if(frm.degree_or_diploma)
	{
	if(frm.degree_or_diploma.value!='')
		flag_for_category = 1;
	}
	if(frm.edu_institute)
	{
	if(frm.edu_institute.value!='')
		flag_for_category = 1;
	}
	if(frm.employer)
	{
	if(frm.employer.value!='')
		flag_for_category = 1;
	}
	if(frm.area_of_work)
	{
	if(frm.area_of_work.value!='')
		flag_for_category = 1;
	}
//alert(flag_for_category);
	
	if(flag_for_category==0)
	{
		alert("Sorry! Please select atleast one parameter.")
		return false;
	}
	else 
	{
		return true;
	}
}
// for base64 decode do not change
var Base64 = {

    // private property
    _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

    // public method for encoding
    encode : function (input) {
        var output = "";
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
        var i = 0;

        input = Base64._utf8_encode(input);

        while (i < input.length) {

            chr1 = input.charCodeAt(i++);
            chr2 = input.charCodeAt(i++);
            chr3 = input.charCodeAt(i++);

            enc1 = chr1 >> 2;
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
            enc4 = chr3 & 63;

            if (isNaN(chr2)) {
                enc3 = enc4 = 64;
            } else if (isNaN(chr3)) {
                enc4 = 64;
            }

            output = output +
            this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
            this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

        }

        return output;
    },

    // public method for decoding
    decode : function (input) {
        var output = "";
        var chr1, chr2, chr3;
        var enc1, enc2, enc3, enc4;
        var i = 0;

        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

        while (i < input.length) {

            enc1 = this._keyStr.indexOf(input.charAt(i++));
            enc2 = this._keyStr.indexOf(input.charAt(i++));
            enc3 = this._keyStr.indexOf(input.charAt(i++));
            enc4 = this._keyStr.indexOf(input.charAt(i++));

            chr1 = (enc1 << 2) | (enc2 >> 4);
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
            chr3 = ((enc3 & 3) << 6) | enc4;

            output = output + String.fromCharCode(chr1);

            if (enc3 != 64) {
                output = output + String.fromCharCode(chr2);
            }
            if (enc4 != 64) {
                output = output + String.fromCharCode(chr3);
            }

        }

        output = Base64._utf8_decode(output);

        return output;

    },

    // private method for UTF-8 encoding
    _utf8_encode : function (string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // private method for UTF-8 decoding
    _utf8_decode : function (utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while ( i < utftext.length ) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i+1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i+1);
                c3 = utftext.charCodeAt(i+2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

}

var sample = '<link href=\"http://www.laptopcommunity.resolvequery.com/style_widget.css\" rel=\"stylesheet\" type=\"text/css\" /><table border=\"0\"  cellpadding=\"0\" cellspacing=\"0\"><tr id=\"topTr\"><td><table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" style=\"height:28px;\"><tr><td align=\"right\" valign=\"middle\" style=\"font-weight:normal; line-height:20px; font-size:13px; background:; padding: 0 5px 0 0;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr></tr></table></td></tr></table></td></tr><tr><td id=\"scrollPanel\" valign=\"middle\" style=\"\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\" height:28px; font-weight:bold;  font-size:13px; width:534px; background:#A9D2F0; color:#000000;\"><tr><td align=\"left\" width=\"50%\" style=\"padding: 0 0 0 3px; font-weight:normal\">Laptop Q&A Panel</td><td align=\"right\" width=\"50%\" style=\"text-align: right;\"><a href=\"http://www.laptopcommunity.resolvequery.com/be_expert.php?~USER_INFO~\" style=\"margin-right:6px;color:#000000; font-weight:normal;\" target=\"_blank\">Are you a laptop expert? Click here</a></td></tr></table></td></tr><tr><td id=\"educationPanel\" height=\"105\"><script type=\"text/javascript\">var marqueecontent=\'\'; marqueecontent=\'<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:solid 1px #eaeaea;\"><tr><td valign=\"top\"><table border=\"0\" cellpadding=\"3\" class=\"content\" style=\"border-left:#848484 1px solid;\"><tr><td valign=\"top\" width=\"90px\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=296\" class=\"pic\"  target=\"_blank\"><img src=\"http://www.laptopcommunity.resolvequery.com/upload_image/2Y9D8X9O3Q_file.jpg\" alt=\"Ramik Sadana\" width=\"90px\" height=\"90px\" /></a></td><td valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td colspan=\"3\" align=\"left\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=296\" target=\"_blank\"><strong style=\"display:block;color:#000000;\">Ramik Sadana</strong></td></tr><tr><td nowrap=\"nowrap\" valign=\"top\" align=\"left\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=296\" target=\\\"_blank\\\"><strong style=\"display:block; color:#da0011;\">Field of Expertise</strong><span style=\"color:#000000 \">Apple and HP</span></a></td></tr></table></td></tr></table></td><td valign=\"top\"><table border=\"0\" cellpadding=\"3\" class=\"content\" style=\"border-left:#848484 1px solid;\"><tr><td valign=\"top\" width=\"90px\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=344\" class=\"pic\"  target=\"_blank\"><img src=\"http://www.laptopcommunity.resolvequery.com/logo_upload/default8.gif\" alt=\"Rahul Gupta\" width=\"90px\" height=\"90px\" /></a></td><td valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td colspan=\"3\" align=\"left\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=344\" target=\"_blank\"><strong style=\"display:block;color:#000000;\">Rahul Gupta</strong></td></tr><tr><td nowrap=\"nowrap\" valign=\"top\" align=\"left\"><a href=\"http://www.laptopcommunity.resolvequery.com/detail_expert_view_home.php?~USER_INFO~expert_id=344\" target=\\\"_blank\\\"><strong style=\"display:block; color:#da0011;\">Field of Expertise</strong><span style=\"color:#000000 \">Dell,<br/> Lenovo,<br/> LG,<br/><br />Toshiba,<br/> Fujitsu,<br/> and HP</span></a></td></tr></table></td></tr></table></td></tr></table>\';</script><script type=\"text/javascript\">var marqueebgcolor = \"#eaeaea\"; var marqueewidth = \"534px\"; var marqueeheight = \"105px\"; var marqueespeed=2;  var pauseit=1; marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-0); var copyspeed=marqueespeed; var pausespeed=(pauseit==0)? copyspeed: 0; var iedom=document.all||document.getElementById; if (iedom) { document.write(\"<span id=\\\"tempTable\\\" style=\\\"visibility:hidden;position:absolute;top:-100px;left:-9000px;\\\">\"+marqueecontent+\"</span>\"); } var actualwidth=\'\'; var cross_marquee, ns_marquee; function populate(){ if (iedom){ cross_marquee=document.getElementById? document.getElementById(\"iemarquee\") : document.all.iemarquee; cross_marquee.style.left=parseInt(marqueewidth)+8+\"px\"; cross_marquee.innerHTML=marqueecontent; actualwidth=document.all? tempTable.offsetWidth : document.getElementById(\"tempTable\").offsetWidth; } else if (document.layers){ ns_marquee=document.ns_marquee.document.ns_marquee2; ns_marquee.left=parseInt(marqueewidth)+8; ns_marquee.document.write(marqueecontent); ns_marquee.document.close(); actualwidth=ns_marquee.document.width; } lefttime=setInterval(\"scrollmarquee()\",20); } window.onload=populate; function scrollmarquee(){ if (iedom){ if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)) { cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+\"px\"; } else { cross_marquee.style.left=parseInt(marqueewidth)+8+\"px\"; } } else if (document.layers){ if (ns_marquee.left>(actualwidth*(-1)+8)) { ns_marquee.left-=copyspeed; } else {ns_marquee.left=parseInt(marqueewidth)+8; } } } if (iedom||document.layers){ with (document){ document.write(\"<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"><td>\"); if (iedom){ write(\"<div style=\\\"position:relative;width:\"+marqueewidth+\";height:\"+marqueeheight+\";overflow:hidden;\\\">\"); write(\"<div style=\\\"position:absolute;width:\"+marqueewidth+\";height:\"+marqueeheight+\";background-color:\"+marqueebgcolor+\"\\\" onMouseover=\\\"copyspeed=pausespeed\\\" onMouseout=\\\"copyspeed=marqueespeed\\\">\"); write(\"<div id=\\\"iemarquee\\\" style=\\\"position:absolute;left:0px;top:0px\\\"></div>\"); write(\"</div></div>\"); } else if (document.layers){ write(\"<ilayer width=\"+marqueewidth+\" height=\"+marqueeheight+\" name=\\\"ns_marquee\\\" bgColor=\"+marqueebgcolor+\">\"); write(\"<layer name=\\\"ns_marquee2\\\" left=0 top=0 onMouseover=\\\"copyspeed=pausespeed\\\" onMouseout=\\\"copyspeed=marqueespeed\\\"></layer>\"); write(\"</ilayer>\"); } document.write(\"</td></table>\"); } } </script></td></tr><tr><td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"width: 100%;\"><p class=\"panelBot\">&nbsp;</p><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\" style=\"width:270px; float:left; padding:0 0 0 0; border-style:solid; border-color:#FFFFFF; border-width:1px; overflow:hidden;\"><tr><td style=\"height:30px; font-size:13px; padding-left: 5px; background:#A9D2F0; color:#000000; font-weight:;\" valign=\"middle\">Select Expert & Ask Question:</td></tr><tr><td style=\"background:#eaeaea; border-top:#E5DEA5 1px solid; width:270px; height:120px;\" valign=\"top\"><form method=\"POST\" action=\"http://www.laptopcommunity.resolvequery.com/~TEMPLINK~?~USER_INFO~\" target=\"_self\" onsubmit=\"return category_chk(this);\"><table style=\"width: 100%;\"><tr><td valign=\"top\" style=\"padding-left: 5px;\"><select name=\"gen_category\" size=\"1\" style=\"width:240px; height:21px; margin:0 0 8px 0;\"><option selected value=\"\">Field of Expertise: Select option</option><option value=\"Apple and HP\">Apple and HP</option><option value=\"Dell, Lenovo, LG, Toshiba, Fujitsu, and HP\">Dell, Lenovo, LG, Toshiba, Fujitsu, and HP</option></select><br></div></td></tr><tr><td style=\"height:21px;  padding-left: 5px;\"><input type=\"submit\" name=\"button\" style=\"width:105px; height:23px; padding-bottom:2px; font-weight:bold; text-align:center; line-height:14px; font-size:11px; border:none; cursor:pointer; margin:0 15px 0 0; float:left; background:#A9D2F0; border:1px solid #A9D2F0; color:#000000\" value=\"Search expert\" /></td></tr></table></form></td></tr></table><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"float: left; width:260px; border-style:solid; border-color:#FFFFFF; border-width:1px; margin: 0 0 0 3px;\"><tr><td style=\"background:#A9D2F0; height:30px; font-size:13px; padding-left: 5px; color:#000000; font-weight:;\" valign=\"middle\">View Archive Based On:</td></tr><tr><td style=\"border-top:#E5DEA5 1px solid; background:#eaeaea; height:120px;\" valign=\"top\"><table style=\"width: 100%;\"><tr><td style=\" padding-left: 5px;\" valign=\"middle\"><ul><li style=\" padding:0 0 8px 0; _padding:0 0 4px 0;\"><a href=\"http://www.laptopcommunity.resolvequery.com/type_queries.php?~USER_INFO~type=expertise\" style=\"font-size:12px; font-weight:bold; text-decoration:underline; color:#000; background-color:inherit;\" target=\"\">Field of Expertise</a></li></div></ul></td></tr><tr><td style=\"height:21px; padding-left: 5px;\"><a href=\"http://www.laptopcommunity.resolvequery.com/sample_response_query.php?~USER_INFO~type=all\" target=\"_self\" style=\"height:21px; font-weight:bold; text-align:center; line-height:21px; font-size:11px; border:none; cursor:pointer;	margin:0 15px 0 0; padding: 0 2px 0 2px; float:left; background:#A9D2F0; border:1px solid #A9D2F0; color:#000000; text-decoration:none;\">View full archive</a></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td><p class=\"blankspac\">&nbsp;</p></td></tr></table>';
var categoryID = 'OA==';
var visitorStatus = '1';
var temp = "";
if(name!=undefined && name!="") {
temp = temp + "Name="+name+"&amp;";
}

if(email!=undefined && email!="") {
temp = temp + "eMailID="+email+"&amp;";
}

if(username!=undefined && username!="") {
temp = temp + "useRName="+username+"&amp;";
}

if(password!=undefined && password!="") {
	temp = temp + "pasSWord="+password+"&amp;";
}

if(username!=undefined && username!="" && Base64.decode(username) != '' && password!=undefined && password!="" && Base64.decode(password) != ''){
	sample = sample.replace(/~USER_INFO~/g, temp+"&amp;catAssignId="+categoryID+"&amp;site_reff=reff&amp;");
	sample = sample.replace(/~TEMPLINK~/, "expert_type_search.php");
}
else {
	sample = sample.replace(/~TEMP~/, "display:none");
	sample = sample.replace(/~USER_INFO~/g, temp+"catAssignId="+categoryID+"&amp;site_reff=reff&amp;");
	//sample = sample.replace(/~TEMPLINK~/, "home_page_expert_search_post.php");
	if(visitorStatus == 1) 
	{
		sample = sample.replace(/~TEMPLINK~/, "expert_type_search.php");
	}
	else
	{
		sample = sample.replace(/~TEMPLINK~/, "home_page_expert_search_post.php");
	}
}
document.write(sample);



