var http = createRequestObject();
var lastUrl = '';
var current_url = '';
var field = '';
var interval = '';
var loading=0;
function createRequestObject() {
var xmlhttp;
try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(f) { xmlhttp=null; }
}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
xmlhttp=new XMLHttpRequest();
}
return xmlhttp;
}
function sendRequest(current_url,act) {
try{
field = document.getElementById("data_field");
if (loading==0) {
loading=1;
show_Loading();
}
current_url="online_ads";
http.open('POST', 'http://www.spiralize.com/page.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse;
http.send('url='+current_url);
exit();
}
catch(e){}
finally{}
}
function handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
// document.getElementById("loading").style.display = "none";
hide_Loading();
loading=0;
response = http.responseText;
if (current_url.indexOf('Play') != -1 || current_url.indexOf('Gift') != -1) {
field.style.marginBottom = "10";
/*document.getElementById("show_hide").style.display = "block";*/
}
field.innerHTML = response;
//field.style.display = "";
//field.scrollIntoView();
}
}
catch(e){}
finally{}
}
// NDK Loading
var ie45,ns6,ns4,dom;
if (navigator.appName=="Microsoft Internet Explorer") ie45=parseInt(navigator.appVersion)>=4;
else if (navigator.appName=="Netscape"){ ns6=parseInt(navigator.appVersion)>=5; ns4=parseInt(navigator.appVersion)<5;}
dom=ie45 || ns6;
var timershow=false;
var curx=-200;
var cury=200;
var mid_w=500;
var timershow1=window.setInterval("stayMiddle()",1);
function getobj(id) {
el = document.all ? document.all[id] : dom ? document.getElementById(id) : document.layers[id];
return el;
}
function show_Loading() {
obj = getobj('data_field');
nshow();
loading=0;
}
function hide_Loading() {
obj = getobj('data_field');
nhide();
}
function moveobj(obj,x,y) {
}
function stayMiddle() {
if (document.documentElement && document.documentElement.scrollTop)
var pY = document.documentElement.scrollTop;
else if (document.body)
var pY = document.body.scrollTop;
obj = getobj('data_field');
}
function nshow() {
}
function nhide() {
}
// End
function getVar(url,cnt)
{
// url=url+'#';
url=url[1];
url=url+',';
url=url.split(',');
if (url[0] == 'Logout')
document.location.href = '?refresh=1';
if (cnt != -1) {
url=url[cnt];
if (!url) return '';
}
return url;
}
function loadPage() {
act = getVar(window.location.href,0);
if (act) {
current_url=window.location.href;
/* current_url=current_url+'#';
current_url=current_url.split('#');
current_url=current_url[1];*/
if (current_url) sendRequest(current_url,act);
}
}
function urlCheck()
{
url=window.location.href;
if (url.indexOf('?') != -1 ) {
url_temp = url.split('?');
clearInterval(interval);
window.location.href = url_temp[0];
}
if (url != '' && url!=lastUrl)
{
loadPage();
lastUrl=url;
}
}
function startLoad() {
var interval = setInterval('urlCheck()',100);
}
function alertBrokenLink(id) {
if (confirm("Bad Link ?")) {
try{
http.open('POST', 'page.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = BrokenResponse;
http.send('url=Broken,'+id);
}
catch(e){}
finally{}
}
}
/*------------------------------------------------------*/
function trim(a) {
return a.replace(/^s*(S*(s+S+)*)s*$/, "$1");
}
// + ---------------------- +
// | REGISTER |
// + ---------------------- +
function reg_handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("reg_loading").style.display = "none";
var response = http.responseText;
if (response) {
if (response!="Send email Sucessful!"){
document.getElementById("reg_loading").innerHTML = response;
document.getElementById("reg_loading").style.display = "block";
}
else {
window.location.href = 'http://www.spiralize.com/thanks/';
}
}
}
}
catch(e){}
finally{}
}
function reg_check_values() {
ok = false;
name = encodeURIComponent(document.getElementById("name").value);
company = encodeURIComponent(document.getElementById("company").value);
tel1 = encodeURIComponent(document.getElementById("tel1").value);
tel2 = encodeURIComponent(document.getElementById("tel2").value);
tel3 = encodeURIComponent(document.getElementById("tel3").value);
email = encodeURIComponent(document.getElementById("email").value);
secCode = encodeURIComponent(document.getElementById("secCode").value);
message = encodeURIComponent(document.getElementById("message").value);
try{
document.getElementById("reg_loading").innerHTML = "Sending....";
document.getElementById("reg_loading").style.display = "block";
http.open('POST', 'http://www.spiralize.com/feedback.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = reg_handleResponse;
http.send('name='+name+'&email='+email+'&secCode='+secCode+'&message='+message+'&tel1='+tel1+'&tel2='+tel2+'&tel3='+tel3+'&company='+company);
}
catch(e){}
finally{
}
return ok;
}
function reg_Response() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("reg_loading").style.display = "none";
var response = http.responseText;
if (response) {
if (response!="ok"){
document.getElementById("reg_loading").innerHTML = response;
document.getElementById("reg_loading").style.display = "block";
}
else
{
window.location.href = 'http://www.spiralize.com/thanks/';
}
}
else {
window.location.href = 'http://www.spiralize.com/contactus/';
}
}
}
catch(e){}
finally{}
}
function registered() {
ok = false;
name = encodeURIComponent(document.getElementById("name").value);
email = encodeURIComponent(document.getElementById("email").value);
secCode = encodeURIComponent(document.getElementById("secCode").value);
message = encodeURIComponent(document.getElementById("message").value);
newsid = encodeURIComponent(document.getElementById("newsid").value);
subof = encodeURIComponent(document.getElementById("subof").value);
try{
document.getElementById("reg_loading").innerHTML = "Sending....";
document.getElementById("reg_loading").style.display = "block";
http.open('POST', 'http://www.spiralize.com/postcomments.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = reg_Response;
http.send('name='+name+'&email='+email+'&secCode='+secCode+'&message='+message+'&id='+newsid+'&subof='+subof);
}
catch(e){}
finally{
}
return ok;
}
function searchnews_Response() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("reg_loading").style.display = "none";
var response = http.responseText;
document.getElementById("reg_loading").innerHTML = response;
document.getElementById("reg_loading").style.display = "block";
}
}
catch(e){}
finally{}
}
function searchnews() {
ok = false;
key = encodeURIComponent(document.getElementById("key").value);
try{
document.getElementById("reg_loading").innerHTML = "Sending....";
document.getElementById("reg_loading").style.display = "block";
http.open('POST', 'http://www.spiralize.com/searchnews.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = searchnews_Response;
http.send('key='+key);
}
catch(e){}
finally{
}
return ok;
}
function sendemail() {
ok = false;
name = encodeURIComponent(document.getElementById("name").value);
email = encodeURIComponent(document.getElementById("email").value);
secCode = encodeURIComponent(document.getElementById("secCode").value);
message = encodeURIComponent(document.getElementById("message").value);
sendname = encodeURIComponent(document.getElementById("sendname").value);
sendemail = encodeURIComponent(document.getElementById("sendemail").value);
try{
document.getElementById("reg_loading").innerHTML = "Sending....";
document.getElementById("reg_loading").style.display = "block";
http.open('POST', 'http://www.spiralize.com/sendcomments.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = reg_Response;
http.send('name='+name+'&email='+email+'&secCode='+secCode+'&message='+message+'&sendname='+sendname+'&sendemail='+sendemail);
}
catch(e){}
finally{
}
return ok;
}
function domain_handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("data_field").style.display = "none";
var response = http.responseText;
if (response) {
document.getElementById("data_field").innerHTML = response;
document.getElementById("data_field").style.display = "block";
}
else {
window.location.href = 'http://www.spiralize.com/contactus/';
}
}
}
catch(e){}
finally{}
}
function checkdomain() {
ok=false;
domainname = encodeURIComponent(document.getElementById("domain_name").value);
domain_tld = encodeURIComponent(document.getElementById("tld").value);
try{
document.getElementById("data_field").innerHTML = "Checking domain, please wait.
";
document.getElementById("data_field").style.display = "block";
http.open('POST', 'http://www.spiralize.com/domain_available.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = domain_handleResponse;
http.send('domain_name='+domainname+'&tld='+domain_tld);
}
catch(e){}
finally{
}
return ok;
}
function show1(dic) {
obj = getobj(dic);
if (obj.style.display == "block")
obj.style.display = "none";
else
obj.style.display = "block";
}
function hide1(dic) {
obj = getobj(dic);
obj.style.display = "none";
}
function getlink_handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("linkpage").style.display = "none";
var response = http.responseText;
if (response) {
document.getElementById("linkpage").innerHTML = response;
document.getElementById("linkpage").style.display = "block";
}
else {
window.location.href = 'http://www.spiralize.com/contactus/';
}
}
}
catch(e){}
finally{}
}
function getlink(url) {
url=url+"&sid="+Math.random();
try{
document.getElementById("linkpage").innerHTML = "Loading.
";
document.getElementById("linkpage").style.display = "block";
http.open('GET', url,true);
http.onreadystatechange = getlink_handleResponse;
http.send(null);
}
catch(e){}
finally{
}
}
function getlink2_handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("reply").style.display = "none";
var response = http.responseText;
if (response) {
document.getElementById("reply").innerHTML = response;
document.getElementById("reply").style.display = "block";
}
else {
window.location.href = 'http://www.spiralize.com/contactus/';
}
}
}
catch(e){}
finally{}
}
function getlink2(url) {
url=url+"&sid="+Math.random();
try{
document.getElementById("reply").innerHTML = "Loading.
";
document.getElementById("reply").style.display = "block";
http.open('GET', url,true);
http.onreadystatechange = getlink2_handleResponse;
http.send(null);
}
catch(e){}
finally{
}
}
function getlink1(url) {
url=url+"?sid="+Math.random();
try{
document.getElementById("linkpage").innerHTML = "Loading.
";
document.getElementById("linkpage").style.display = "block";
http.open('GET', url,true);
http.onreadystatechange = getlink_handleResponse;
http.send(null);
}
catch(e){}
finally{
}
}
function reg_domain_handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("reg_loading").style.display = "none";
var response = http.responseText;
if (response) {
if (response!="Send email Sucessful!"){
document.getElementById("reg_loading").innerHTML = response;
document.getElementById("reg_loading").style.display = "block";
}
else
{
window.location.href = 'http://www.spiralize.com/thanks/';
}
}
else {
window.location.href = 'http://www.spiralize.com/contactus/';
}
}
}
catch(e){}
finally{}
}
function reg_domain() {
ok = false;
name = encodeURIComponent(document.getElementById("name").value);
domainname = encodeURIComponent(document.getElementById("domainname").value);
company = encodeURIComponent(document.getElementById("company").value);
tel1 = encodeURIComponent(document.getElementById("tel1").value);
tel2 = encodeURIComponent(document.getElementById("tel2").value);
tel3 = encodeURIComponent(document.getElementById("tel3").value);
email = encodeURIComponent(document.getElementById("email").value);
secCode = encodeURIComponent(document.getElementById("secCode").value);
message = encodeURIComponent(document.getElementById("message").value);
try{
document.getElementById("reg_loading").innerHTML = "Sending....";
document.getElementById("reg_loading").style.display = "block";
http.open('POST', 'http://www.spiralize.com/domainregister.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = reg_handleResponse;
http.send('name='+name+'domain'+domainname+'&email='+email+'&secCode='+secCode+'&message='+message+'&tel1='+tel1+'&tel2='+tel2+'&tel3='+tel3+'&company='+company);
}
catch(e){}
finally{
}
return ok;
}
/*Thanh Tung*/
function On_CheckClick(oCheck,oDivs)
{
if(oDivs != null && oDivs.length != 0)
{
for(var i = 0;i < oDivs.length;i++)
{
o = document.getElementById(oDivs[i]);
if(oCheck.checked == true)
{
if(o.getAttribute("iCount")== null || o.getAttribute("iCount")== 0)
{
o.setAttribute("iCount",1);
o.style.display = "block";
}
else
{
so = parseInt(o.getAttribute("iCount"));
o.setAttribute("iCount",so + 1);
}
}
else
{
so = parseInt(o.getAttribute("iCount"));
if(so > 0)
{
o.setAttribute("iCount",so - 1);
so = parseInt(o.getAttribute("iCount"));
if(so == 0)
{
o.style.display = "none";
o.removeAttribute("iCount");
}
}
}
}
}
}
function foil()
{ show1('foil'); hide1('embossing'); hide1('silkmax'); hide1('clear'); hide1('uv'); hide1('diecut');
}
function embossing()
{ show1('embossing'); hide1('foil'); hide1('silkmax'); hide1('clear'); hide1('uv'); hide1('diecut');
}
function silkmax()
{ show1('silkmax'); hide1('foil'); hide1('embossing'); hide1('clear'); hide1('uv'); hide1('diecut');
}
function clear()
{ show1('clear'); hide1('foil'); hide1('embossing'); hide1('silkmax'); hide1('uv'); hide1('diecut');
}
function uv()
{ show1('uv'); hide1('foil'); hide1('embossing'); hide1('silkmax'); hide1('clear'); hide1('diecut');
}
function diecut()
{ show1('diecut'); hide1('foil'); hide1('embossing'); hide1('silkmax'); hide1('clear'); hide1('uv');
}
function copyrightprimary()
{ show1('copyrightprimary'); hide1('graphicdesignlogo'); hide1('saleandmaketing');
}
function graphicdesignlogo()
{ show1('graphicdesignlogo'); hide1('copyrightprimary'); hide1('saleandmaketing');
}
function saleandmaketing()
{ show1('saleandmaketing'); hide1('copyrightprimary'); hide1('graphicdesignlogo');
}
function sets(url)
{
window.open(url+location.href+"&title="+document.title+"Print Spiralize News","menubar=1,resizable=1");
}
function openwindow(url)
{
window.open(url,"Print Spiralize News","menubar=1,resizable=1");
}
function apply(frm,filename) {
ok = false;
//var e = document.forms['test'].elements;
var e = frm.elements;
var opts = [];
var post;
for (i=0; i0){
for (var i=0; i