﻿d = document;
w = window;
function getid(id){
    return d.getElementById(id); 
}
function getname(name){
    return d.getElementsByName(name); 
}
function openwin(url, title, other){
	if (other == null){
		other = 'height=500, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no'
	}
	window.open (url, title, other);
}
function addfav(){
	w.external.AddFavorite(location.href, d.title);
}
function tsize(n, who){
	if(who == null){who = 'content';}
	$("#" + who).css({"font-size": n + "px"});
}
function loadjs(name){
	d.write('<script src="/js/' + name + '.js"></script>');
}

loadjs('jq');
loadjs('jalert');
loadjs('cookie');
loadjs('flash');
loadjs('base64');

function account(){
	var ac = getCK("ac[id]");
	if(ac==''){
		d.write('<a href="/account/login" class="p2 k">Login</a>');
	}
	else{
		d.write('<a href="/data">' + $.base64Decode(getCK("ac[uname]")) + '</a>');
		d.write('<a href="/car" class="p2 k mr4 ml4">My Cart</a>');
		d.write(' <a href="/account/logout"  class="p2 k">logout</a>');
	}
}
