|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /home/jackjohn/public_html/shopsite-images/en-CX/javascript/ |
Upload File : |
function get_cookie(name){var b=document.cookie;var c=b.search(new RegExp("\\b"+name+"="));if(c==-1)c=b.indexOf(name+"=");if(c==-1)b=null;else{c=b.indexOf("=",c)+1;var d=b.indexOf(";",c);if(d==-1)d=b.length;b=unescape(b.substring(c,d));}return b;}
function findParentNode(parentName, childObj) {
var p = childObj.parentNode;
while(p.getAttribute('name') != parentName) {
if (p == null || p.tagName == "HTML")
return false;
p = p.parentNode;
}
return true;
}
function add_hidden_input(p, name, val)
{
if(typeof val === 'undefined'){return false}
var e = document.createElement('input');
e.type='hidden';e.name=name;e.value=val;
p.appendChild(e);
return true;
}
function do_facebook_signin(response) {
var ar=response.authResponse, div=document.createElement('div');
if((response.status != 'connected')||(typeof ar == 'undefined')){return false}
if(!add_hidden_input(div,'uid',ar.userID) ||
!add_hidden_input(div,'fbat',ar.accessToken)){return false}
var el = document.getElementById('fb_connect');
var isInForm = findParentNode('cr', el);
if (isInForm) {
var x=document.forms['cr'];
x.elements['func'].value = "8";
x.appendChild(div);
x.submit();
} else {
var sbid_found = false;
var form = document.forms[0];
if (form != null) {
var sbid_el = form.elements['sbid'];
if (sbid_el != null) {
sbid = sbid_el.value;
sbid_found = true;
}
}
if (!sbid_found) {
sbid = get_cookie("sbid");
if(sbid == null)
sbid = get_cookie("sbid1");
if (sbid != null)
sbid_found = true;
}
var f = document.createElement('form');
f.id='fb_info';
f.method='post';
f.action=sb_url+'/order.cgi';
add_hidden_input(f,'storeid',storeid);
add_hidden_input(f,'func','8');
add_hidden_input(f,'html_reg','html');
if(sbid_found){add_hidden_input(f,'sbid',sbid)}
f.appendChild(div);
var newdiv = document.createElement("div");
newdiv.appendChild(f);
var body = document.getElementsByTagName("body");
body[0].appendChild(newdiv);
document.forms['fb_info'].submit();
}
return true;
}
function facebook_logout() {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
FB.logout(function(response) {});
}
});
}
function facebook_login() {
FB.getLoginStatus(do_facebook_signin);
}
if(location.protocol === 'https:') {
(function(d,s,id) {
var js,fjs=d.getElementById('fb-root');
if(d.getElementById(id)){return}
js=d.createElement(s);js.id=id;js.src="https://connect.facebook.net/en_US/sdk.js";
fjs.appendChild(js);
}(document, 'script', 'facebook-jssdk'));
window.fbAsyncInit = function() {
FB.init({appId: ss_appId, status: true, cookie: true, xfbml: true, version:'v6.0'});
};
} else {ss_jQuery('#fb_connect').hide();}